You are on page 1of 26

MID-TERM EXAMINATION 2020-2021

Paper I
Subject: Computers Seat #:
Class: X Section:
Time Allowed: 2 Hours Block #
Sub. Teacher’s sign Date:
Co. Teacher’s sign Invigilator’s Name:
HOD’s sign Invigilator Sign:
INSTRUCTION
1. Read each question carefully, While answering the questions:
1.1.1. Use a black pencil for diagrams. DO NOT use colored pencils.
1.1.2. DO NOT use staples, paper clips, glue, correcting fluid or ink erasers.
1.1.3. Complete your answer in the allocated space only.
1.1.4. DO NOT write outside the answer box.
2. The Marks for the questions are shown in brackets ( )

Marking Block:

Obtained
Marks

50 0
Paper I Paper II 50 Total Marks

Head of Department Principal


1. What is the output of this statement "printf("%d", a)"?

Computers X Paper I Page 1 of 26


a. The value of (a + 1)
b. The current value of a
c. Error message
d. Garbage
2. How many times will the following loop execute?
for(j = 0; j <= 10; j = j+2)
a. Forever b. Never
c. 5 d. 6
3. What is the result after execution of the following code if a is 5, b is 10, and c is 10?
If ((a > b) && (a <= c))
a = a + 1;
else
c = c+1;
a. a = 5, c = 10 b. a = 11, c = 5
c. a = 5, c = 11 d. a = 11, c = 10
4. Which one of the following is a loop construct that will always be executed on the basis of condition?
a. for b. while
c. b&d d. do while
5.

6. What feature makes C++ so powerful?


a. Easy implementation
b. Reusing the old code
c. Easy memory management
d. All of the above
7. What will the result of num variable after execution of the following statements?
int num = 58;
num % = 12;
a. 3 b. 10
c. 8 d. 11
8. Which is valid expression in c language?
a. int my_num = 100,000;
b. int my_num = 100000;
c. int my num = 1000;
d. int my num == 10000;
9. What will the result of num1 variable after execution of the following statements?
int j = 1, num1 = 1;
for (j=1, j<6, j++)
{
num1++;
}
a. 5 b. 6
c. 7 d. 8

Computers X Paper I Page 2 of 26


10. If addition had higher precedence than multiplication, then the value of the expression (1 + 2 * 3 + 4 * 5) would
be which of the following?
a. 27 b. 47
c. 69 d. 105
11. What will be the output of this program?
int main()
{
int a=10, b=20;
printf("a=%d b=%d",a,b);
a=a*b;
b=a/b;

printf("a=%d b=%d",a,b);
}
a. a = 200, b = 20 b. a = 200, b = 50
c. a = 200, b = 30 d. a = 200, b = 10
12. What does this statement mean?
x - = y + 1;
a. x=x-y+1 b. x = -x - y - 1
c. x=x+y–1 d. x=x-y-1
13. Study the following statement
for (i = 3; i < 15; i + = 3)
{printf ("%d", i);
++i;
}
What will be the output?
a. 3 6 9 12 b. 3 6 9 12 15
c. 3 7 11 d. 3 7 11 15
14. What will the output after execution of the following statements?
main()
{
printf ("\n Ahmedabad");
printf ("\r Islam");
}
a. Ahmedabad b. Islamabad
c. AhmedIslam d. Islam

15. What will the output after execution of the following statements?
void main()
{
int i = 65, j = 65;
printf ("%d %d", i/5, j%5);
}
a. 13 3 b. 13 0

Computers X Paper I Page 3 of 26


c. 3 13 d. 13 13
16. What is output of below program?

int main()
{
int i,j,count;
count=5;
for(i=1; i<=5; i++);
{
for(j=1;j<=5;j++);
{
count++;
}
}
printf("%d",count);

}
(A) 25 (B) 30
(C) 35 (D) 40
17. What is output of below program?
int main()
{
int i;
for(i=1; i<=15; i=i+2);
{
printf("cppbuzz");
}

}
(A) cppbuzz is printed 5 times
(B) cppbuzz is printed 8 times
(C) cppbuzz is printed 15 times
(D) Nothing is printed
18. What is output of below program?
int main()
{
int i,j,k,count;
count=25;
for(i=0;i<5;i++)
{
for(j=0;j<5;j++)
{
count--;
}

Computers X Paper I Page 4 of 26


}
printf("%d",count);
}
(A) 5 (B) 0
(C) 25 (D) 50
19. What is output of below program?
int main()
{
int i, j=0;
for(i = 1,i<5,i++)
{
printf("%d%d--",j,i);
}
}
(A) 0--01--12--23--34-- (B) 10--20--30--40--
(C) Compilation Error (D) 01--02--03--04--
20. What is output of below program?
int main()
{
int i;
for(i=1; i<=5; i++)
{
i++;
printf("Hello");
}
}
(A) Hello is printed 5 times (B) Hello is printed 1 times
(C) Hello is printed 3 times (D) Hello is printed 3 times
21. What is the output of below program?
int main()
{
int i;
for(i = 0,i<5,i++)
{
printf("Hello");
}
}
(A) Hello is printed 5 times (B) Compilation Error
(C) Runtime Error (D) Hello is printed 4 times
22. When C Language was invented?
(A) 1970 (B) 1972
(C) 1978 (D) 1979
23. Libray function scanf() belongs to which header file?
(A) stdio.h (B) conio.h

Computers X Paper I Page 5 of 26


(C) stdlib.h (D) stdlibio.h
24. What is output of below program?
int main()
{
const int a = 9;
printf("%d",++a/2);
}
(A) 9 (B) 10
(C) 5 (D) 0
25. In switch statement, if the switch variable does not match any of the case constants, then control goes to the
A. if keyword.
B. else keyword.
C. break keyword.
D. default keyword.

26. What should be the output:


int main()
{
int a = 9/3;
printf("%d",a);
}
(A) 3.33 (B) 3.0
(C) 3 (D) 0
27. Which of the following is executed by Preprocess?
(A) #include<stdio.h> (B) return 0
(C) void main()
(D) None of above
28. Output of following program
int main()
{
int a = 5;
int b = 10;
int c = a+b;
printf("%d",c);
}
(A) 0 (B) 15
(C) 10 (D) 5
29. What is the extension of output file produced by Preprocessor?
(A) .h (B) .exe
(C) .i (D) .asm
30. Which compilation unit is responsible for adding header files content in the source code?
(A) Linker (B) Compiler
(C) Assembler (D) Preprocessor
31. The ASCII code of ‘C’ is?

Computers X Paper I Page 6 of 26


(A) 66 (B) 65
(C) 65 (D) 67
32. Numbers are stored and transmitted inside a computer in which format?
(A) binary form (B) ASCII code form
(C) decimal form (D) alphanumeric form
33. Output of following program
#include <stdio.h>
int main()
{
Int a=1
a = 10;
printf("%d",2*a);
}
(A) 10 (B) 20
(C) 2a (D) 0
34. Output of following program
#include <stdio.h>
int main()
{
int @a = 10;
printf("%d",@a);
}
(A) 10 (B) @10
(C) 10@ (D) Compilation Error
35. Output of following program
#include "stdio.h"
int main()
{
int a = 10, b = 20;
if(a=b)
{
printf("Easy");
}
else
{
printf("Hard");
}
}
(A) Easy (B) Hard
(C) EasyHard (D) Error in program

36. Output of following program


#include "stdio.h"
int main()

Computers X Paper I Page 7 of 26


{
if(printf("C programming is"))
{
printf("Easy");
}
else
{
printf("Hard");
}
}
(A) Easy (B) Hard
(C) C programming is Easy D) None of the above
37. What is the job of Assembler in C programming?
(A) It converts source code into assembly code
(B) It converts a assembly language program into machine language
(C) It convert code generated by Preprocessor to assembly code
(D) None of the above
38. Which of the following ways are correct to comment out preprocessing of any line?
(A) -- #include<stdio.h> (B) // #include<stdio.h>
(C) ''#include<stdio.h> (D) ##include<stdio.h>
39. Who invented C Language.?
A) Charles Babbage B) Grahambel
C) Dennis Ritchie D) Steve Jobs
40. C is a which level language.?
A) Low Level B) High Level
C) Low + High D) None
41. High level language is a .?
A) Human readable like language.
B) language with small program size.
C) language with big program size.
D) language which is difficult to understand and not human readable.
42. Which program outputs "Hello World.." .?
A) main()
{
scanf("Hello World..");
}
B) main()
{
printf("Hello World..");
}
C) main()
{
print("Hello World..");
}

Computers X Paper I Page 8 of 26


D) main()
{
scan("Hello World..");
}

43. C is _______ type of programming language.?


A) Object Oriented B) Procedural
C) Bit level language D) Functional

44. C language is used in the development of .?


A) Databases B) Graphic applications
C) Word Processors D) All of the above

45. A C program is a combination of.?


A) Statements B) Functions
C) Variables D) All of the above
46. Correct way of commenting a single line is.?
A) /*printf("Hello C.."); printf("How are you.");
B) //printf("Hello C.."); printf("How are you.");
C) /*printf("Hello C.."); printf("How are you.");*/
D) /printf("Hello C..");/ printf("How are you.");

47. Find an integer constant.


A) 3.145 B) 34
C) "125" D) None of the above
48. Choose correct statements
A) A constant value does not change. A variable value can change according to needs.
B) A constant can change its values. A variable can have one constant value only.
C) There is no restriction on number of values for constants or variables.
D) Constants and Variables can not be used in a singe main function.
49. Find a Floating Point constant.
A) 12.3E5 B) 12e34
C) 125.34857 D) All the above.

50. Find a Character constant.


A) 'A'
'a'
B) '1'
'9'
C) '$'
'#'
D) All the above.
51. Choose a right statement.
A) int myage = 10; int my_age = 10;

Computers X Paper I Page 9 of 26


B) int myage = 10; int my,age = 10;
C) int myage = 10; int my age = 10;
D) All are right
52. Each statement in a C program should end with.?
A) Semicolon ; B) Colon :
C) Period . (dot symbol) D) None of the above.
53. signed and unsigned representation is available for.?
A) short, int, long, char B) float, double, long double
C) A & B D) None of the above
54. Choose a correct statement.
int a = 12 + 3 * 5 / 4 - 10
A) 12, 3, 5, 4 and 10 are Operators. +, -, * and / are Operands. = is an increment operator.
B) 12, 3, 5, 4 and 10 are Operands. +, -, * and / are Operators. = is decrement operator.
C) 12, 3, 5, 4 and 10 are Operands. +, -, * and / are Operators. = is an assignment operator.
D) 12, 3, 5, 4 and 10 are Operands. +, -, * and / are Logical Operators. = is an assignment operator.
55. Operator % in C Language is called.?
A) Percentage Operator B) Quotient Operator
C) Modulus D) Division
56. Choose a right statement.
int a = 10 + 4.867;
A) a = 10 B) a = 14.867
C) a = 14 D) compiler error.
57. Choose a right statement.
int a = 3.5 + 4.5;
A) a = 0 B) a = 7
C) a = 8 D) a = 8.0
58. Choose a right statement.
float var = 3.5 + 4.5;
A) var = 8.0 B) var = 8
C) var = 7 D) var = 0.0
59. Choose right statement.
int main()
{
float c = 3.5 + 4.5;
printf("%f", c);
}
A) 8.0 B) 8.000000
C) 8 D) 7

60. Choose a right statement.


int a = 5/2;
int b = 5.0/2;
int c = 5 / 2.0;
int d = 5.0/2.0;

Computers X Paper I Page 10 of 26


A) a = 2, b = 2, c = 2, d= 2
B) a = 2, b = 2.0, c = 2, d= 2.0
C) a = 2, b = 2.5, c = 2.5, d= 2.5
D) a = 2.5, b = 2.5, c = 2.5, d= 2.5
61. Choose a right statement.
float a = 5/2;
float b = 5/2.0;
float c = 5.0/2;
float d = 5.0/2.0;
A) a=2.5, b=2.5, c=2.5, d=2.5 B) a=2, b=2.5, c=2.5, d=2.5
C) a=2.0, b=2.5, c=2.5, d=2.5
D) a=2.0, b=2.0, c=2.0, d=2.0

62. If both numerator and denominator of a division operation in C language are integers, then we get.?
A) Expected algebraic real value
B) Unexpected integer value
C) Compiler error. D) None of the above

63. Choose a right statement.


int main()
{
int var = 3.5;;
printf("%f", var);
}
A) 3.500000
B) 3
C) 3.5
D) 0.000000

64. What is the output of the program.?


int main()
{
int a = 25%10;
printf("%d", a);
}
A) 2.5 B) 2
C) 5 D) Compiler error.
65. What is the output of the program.?
int main()
{
float a = 45;
printf("%f", a);
}

Computers X Paper I Page 11 of 26


A) 45 B) 45.0
C) 45.000000 D) 0.000000
66. What is the Priority among (*, /, %), (+, -) and (=) C Operators.?
A) (*, /, %) > (+, -) < (=) B) (*, /, %) < (+, -) < (=)
C) (*, /, %) > (+, -) > (=)
D) (*, /, %) < (+, -) (+, -) == (=)
67. What is the output of the C statement.?
int main()
{
int a=0;
a = 4 + 4/2*5 + 20;
printf("%d", a);
}
A) 40 B) 4
C) 34 D) 54
68. What is the output of the C Program.?
int main()
{
int a=0;
a = 10 + 5 * 2 * 8 / 2 + 4;
printf("%d", a);
}
A) 124 B) 54
C) 23 D) 404
69. What is the output of the C Program.?
int main()
{
int a=0;
a = 4 + 5/2*10 + 5;
printf("%d", a);
}
A) 29 B) 5
C) 4 D) 34
70. What is the output of the C Program.?
int main()
{
int a=0;
a = 10 + 2 * 12 /(3*2) + 5;
printf("%d", a);
}
A) 31 B) 19
C) 11 D) 29
71. What is the output of the C Program.?
int main()

Computers X Paper I Page 12 of 26


{
int a=0;
a = 10 + 2 * 12 / 3 * 2 + 5;
printf("%d", a);
}
A) 19 B) 31
C) 11 D) 25
72. What is the output of the C Program.?
int main()
{
float a=10.0;
a = a % 3;
printf("%f", a);
}
A) 0 B) 1
C) 1.000000 D) Compiler error.
73. What is the output of the C Program.?
int main()
{
int a= 3 + 5/2;
printf("%d", a);
}
A) 3 B) 2
C) 5 D) Can not assign an expression to variable at the time of declaration.
74. What is the other name for C Language ?: Question Mark Colon Operator.?
A) Comparison Operator B) If-Else Operator
C) Binary Operator D) Ternary Operator

75. Choose a syntax for C ?: Question Mark Colon Operator from the list.
A) condition ? expression1 : expression2
B) condition : expression1 ? expression2
C) condition ? expression1 < expression2
D) condition < expression1 ? expression2
76. What is the output of the C statement.?
int main()
{
int a=0;
a = 5<2 ? 4 : 3;
printf("%d",a);
}
A) 4
B) 3
C) 5
D) 2

Computers X Paper I Page 13 of 26


77. What is the output of the C Program.?
int main()
{
int a=0;
a = 5>2 ? printf("4"): 3;
printf("%d",a);
}
A) compiler error B) 14
C) 41 D) 0
78. Choose a correct C Statement using IF Conditional Statement.
A) if( condition )
{
//statements;
}
B) if( condition )
{
//statements;
}
else
{
//statements;
}
C) if( condition1 )
{
//statements;
}
else if( condition2)
{
//statements;
}
else
{
//statements;
}
D) All the above.

79. What is the output of the C Program.?


int main()
{
if( 4 > 5 )
{
printf("Hurray..\n");
}
printf("Yes");

Computers X Paper I Page 14 of 26


}

A) Yes B) Hurray.. Yes


C) Hurray..Yes D) Compiler error

80. What is the output of the C Program.?


int main()
{
if( 4 > 5 )
printf("Hurray..\n");
printf("Yes");
}
A) Yes B) Hurray.. Yes
C) Hurray..Yes D) No Output

81. What is the output of the C Program.?


int main()
{
if( 4 < 5 )
printf("Hurray..\n");
printf("Yes");
else
printf("England")
}
A) Hurray..Yes B) Hurray.. Yes
C) Compiler error D) None of the above

82. What is the output of the C Program.?


int main()
{
if( 10 < 9 )
printf("Hurray..\n");
else if(4 > 2)
printf("England");
}
A) England B) Hurray..
C) Compiler error for missing else
D) None of the above
83. What is the output of C Program.?
int main()
{
if( 10 > 9 )
printf("Singapore\n");

Computers X Paper I Page 15 of 26


else if(4%2 == 0)
printf("England\n");
printf("Poland");
}
A) Singapore B) Singapore Poland
C) Singapore England Poland D) England Poland
84. What is the output of the C Program.?
int main()
{
if(-5)
{
printf("Germany\n");
}
if(5)
{
printf("Texas\n");
}
printf("ZING");
}
A) ZING B) Texas ZING
C) Germany Texas ZING
D) Compiler error as a number can not be put as condition inside IF.
85. What is the output of the C Program.?
int main()
{
if(10.0)
{
printf("Texas\n");
}
printf("ZING");
}
A) ZING B) Texas ZING
C) Compiler error. D) None of the above.
86. What is the output of C Program.?
int main()
{
if("abc") {
printf("India\n");
}
if('c') {
printf("Honey\n");
}
printf("ZING");
}

Computers X Paper I Page 16 of 26


A) ZING B) Honey ZING
C) India ZING D) India Honey ZING
87. What is the output of C Program.?
int main()
{
int a=9;
if(a==5);
{
printf("Kangaroo\n");
}
printf("Eggs\n");
}
A) Eggs B) Kangaroo Eggs
C) No output D) Compiler error
88. What is the output of C Program.?
int main()
{
int a=9;
if(a==9); {
printf("Ostrich\n");
}
elseif(a==8)
{
printf("Eggs\n");
}
printf("White");
}
A) White B) Ostrich White
C) No Ouput D) Compiler error
89. What is the output of C Program.?
int main()
{
int a=9, b=5, c=8;
a=b=c=10;
if(a==9)
{
printf("Ostrich\n");
}
else
{
printf("Eggs\n");
}
printf("White");
}

Computers X Paper I Page 17 of 26


A) Ostrich Eggs White B) Ostrich White
C) Eggs White
D) Compiler error as you can not assign to more than two variables at once.

90. What is the output of C Program.?


int main()
{
int a=9, b=5, c=8;

if(!(a==9))
{
printf("Bear\n");
}
else
{
printf("Elephant\n");
}
printf("Fox");
}
A) Bear Fox B) Elephant Fox
C) Fox D) Compiler error
91. What is the output of C Program.?
int main()
{
int a=9, b=6;
if(a==9 && b==6)
{
printf("Hockey");
}
else
{
printf("Cricket");
}
}
A) Cricket Football B) Hockey Football
C) Football D) Compiler error
92. What is the output of C Program.?
int main()
{
int a=9, b=6;
if(a!=9 || b==6)
{
printf("Hockey\n");

Computers X Paper I Page 18 of 26


}
else
{
printf("Cricket\n");
}
printf("Football");
}
A) Cricket Football B) Hockey Football
C) Football D) Compiler error
93. What is the output of C Program.?
int main()
{
int k;

for(k=1; k <= 5; k++) {


printf("%d ", k);
}
}
A) 1 2 3 4 5 B) 1 2 3 4
C) 6 D) 5
94. What is the output of C Program.?
int main()
{
int a=10, b, c;
b=a++;
c=++a;
printf("%d %d %d", a, b, c);
}
A) 10 11 12 B) 12 10 12
C) 12 11 12 D) 12 12 12
95. What is the output of C Program.?
int main()
{
int a=10,b=20;

if(a==9 AND b==20)


{
printf("Hurray..");
}
if(a==10 OR b==21)
{
printf("Theatre");
}
}

Computers X Paper I Page 19 of 26


A) Theatre B) Hurray Theatre
C) No output D) Compiler error
96. What are C ASCII character ranges.?
A) A to Z = 65 to 91
B) a to z = 97 to 122
C) 0 to 9 = 48 to 57
D) All the above
97. What is the output of C Program with Switch Statement.?
int main()
{
int a=5;
switch(a)
{
case 0: printf("0 ");
case 3: printf("3 ");
case 5: printf("5 ");
default: printf("RABBIT ");
}
a=10;
switch(a)
{
case 0: printf("0 ");
case 3: printf("3 ");
case 5: printf("5 ");
default: printf("RABBIT "); break;
}
}
A) 5 RABBIT B) 0 3 5 RABBIT 0 3 5 RABBIT
C) 0 3 5 RABBIT RABBIT D) 3 5 RABBIT RABBIT
98. What is the output of C Program with switch statement.?
int main()
{
int a=3;
switch(a)
{
case 2: printf("ZERO "); break;
case default: printf("RABBIT ");
}
}
A) RABBIT B) ZERO RABBIT
C) No output D) Compiler error
99. What is the output of C Program with switch statement or block.?
int main()
{

Computers X Paper I Page 20 of 26


static int a=5;

switch(a)
{
case 0: printf("ZERO ");break;
case 5: printf("FIVE ");break;
case 10: printf("DEER ");
}
printf("LION");
}
A) ZERO FIVE DEER LION B) FIVE DEER LION
C) FIVE LION D) Compiler error
100. What is the output of C program with switch statement or block.?
int main()
{
char code='K';
switch(code)
{
case 'A': printf("ANT ");break;
case 'K': printf("KING "); break;
default: printf("NOKING");
}
printf("PALACE");
}
A) KING PALACE B) KING NOTHING PALACE
C) ANT KING PALACE D) Compiler error for using Non Integers as CASE constants.
C programming allows a program to run in an operating system that is different from the one it was created in. The given
characteristic of C programming makes it a
A. portable language.
B. structured language.
C. middle-level language.
D. compiler-based language.
A program outputs the word Hello upon its execution. The minimum number of functions that must be used in this
program is
A. one.
B. two.
C. three.
D. four.
Which of the following options shows the CORRECT features of machine language?

Computers X Paper I Page 21 of 26


When a program file named as FirstProgram is compiled, then it has different extensions at different stages of the
compilation process. The correct sequence of processing of this file on the basis of extensions at different stages is
A. FirstProgram.c  FirstProgram.obj  FirstProgram.exe
B. FirstProgram.exe  FirstProgram.obj  FirstProgram.c
C. FirstProgram.obj  FirstProgram.c  FirstProgram.exe
D. FirstProgram.exe  FirstProgram.c  FirstProgram.obj
The following code is written to output the phrase Break the Ice but it contains some error(s).
#include
int main()
{ printf("Break the Ice);
return 0 }
The number of errors in the code is
A. one.
B. two.
C. three.
D. four.
The data type that should be used to store the home address of a person is
A. char.
B. long.
C. float.
D. double.
For getch( ) function, the TRUE statement is that
A. it is a type of user-defined C function.
B. the header file of getch( ) function is stdio.h
C. any C program will not compile in the absence of the getch( ) function.
D. it prompts user to press a character and that character is not printed on the screen.
Read the given incomplete C program.
#include<stdio.h>
int main(void)
{ int x, y;
float z;
The remaining part of this program to get the output 9.60 is

Computers X Paper I Page 22 of 26


A B
x = 3.2; x = 3.3;
y = 3.2; y = 3.1;
z = 3.2; z = 3.2;
printf("%.2f", x + y + z); printf("%.2f", x + y + z);
} }

C D
x = 3.1; x = 3.4;
y = 3.1; y = 3.5;
z = 3.4; z = 3.6;
printf("%.2f", x + y + z); printf("%.2f", x + y + z);
} }

The given C program will


 input width (W) and length (L) values of a rectangle.
 calculate and output area (A) of rectangle.
However, there are a few errors in the shaded segment of this program.
(Note: Area of Rectangle = width × length)

Read the given C program.


#include
int main(void)
{ int x, y, z = 0;
for(y =1; y <= 4; y++)
{ scanf("%d", &x);
Computers X Paper I Page 23 of 26
if( (x + 3) % 5 == 0)
z = z + x; }
printf("result = %d", z);
return 0;
}
If the input of this program is four numbers, i.e. 4, 5, 6, 7, then the output would be
A. 0
B. 5
C. 7
D. 10
Read the given program.
#include
void main( ) {
int a = 5; int b = 10;
if(a < 5 || b > 10)
printf("%d", a * b);
else
printf("%d", b / a);
}
The output of the given code is
A. 2
B. 5
C. 10
D. 50
Consider the following C language program.
#include
int main( ) {
int j = 1; int k = 3;
while(j < k)
{ k = k + 2;
printf("\nIslamabad");
j = j + 3;
}
return 0;
}
If the given program is executed, then the number of times Islamabad is printed on the screen is
A. one.
B. two.
C. three.
D. four.
Read the given C program.
#include
int main(void)
{ printf("Hello\nWorld");

Computers X Paper I Page 24 of 26


return 0;
}
The output of the given C program will be

Consider the given statement. int X = 9/2;


Upon execution of this statement, which of the following values will be stored in X?
A. 0
B. 4
C. 4.5
D. 5
Which of the given programs will output Z on screen?

Consider the given program.


#include
void main() {
float a = 1244.6713877;
printf("%.4f\n", a);
}
The output of this program is
A. 1244.67138e+02
B. 1.244671e+03
C. 1244.671387
D. 1244.6714
Computers X Paper I Page 25 of 26
Which of the following options CORRECTLY differentiates unary operators from binary operators based on the given
examples?

Computers X Paper I Page 26 of 26

You might also like