Home

C Programming MCQ Solved Paper for SSC Stenographer

Thursday 9th of March 2023

Sharing is caring

1. Which of the following is not a preprocessor directive
A. #if
B. #elseif
C. #undef
D. #pragma
Answer : B
2. The statement "for (i = 0, j = 2; j <= 10; j++)" is a valid statement in 'C'.
A. True
B. False
C.
D.
Answer : A
3. continue statement is used
A. to go to the next iteration in a loop
B. come out of a loop
C. exit and return to the main function
D. restarts iterations from beginning of loop
Answer : D
4. The contents of a file opened in 'r+' mode cannot be changed.
A. True
B. False
C.
D.
Answer : B
5. perror( ) function used to ?
A. Work same as printf()
B. prints the error message specified by the compiler
C. prints the garbage value assigned by the compiler
D. None of the above
Answer : B
6. All macro substitutions in a program are done before compilation of the program.
A. True
B. False
C.
D.
Answer : A
7. Left shift operator rotates the bits on the left and places them to the right.
A. True
B. False
C.
D.
Answer : B
8. The main() function can be called from any other function.
A. True
B. False
C.
D.
Answer : A
9. && and & operators have the same meaning.
A. True
B. False
C.
D.
Answer : B
10. For 16?bit compiler allowable range for integer constants is ______ ?
A. ?3.4e38 to 3.4e38
B. ?32767 to 32768
C. ?32768 to 32767
D. ?32668 to 32667
Answer : C
11. What is the right way to access value of structure variable book{ price, page }?
A. printf("%d%d", book.price, book.page);
B. printf("%d%d", price.book, page.book);
C. printf("%d%d"< price::book< page::book);
D. printf("%d%d", price?>book, page?>book);
Answer : A
12. p++ executes faster than p + 1.
A. True
B. False
C.
D.
Answer : A
13. unsigned' is a valid variable name.
A. True
B. False
C.
D.
Answer : B
14. No commas or blanks are allowed within an integer or a real constant.
A. True
B. False
C.
D.
Answer : A
15. Every if statement can be converted into an equivalent switch statement.
A. True
B. False
C.
D.
Answer : B
16. struct stud
{
int roll;
char name[20];
float marks;
} *p;
What will be the byte size of p?

A. 24
B. 2
C. 26
D. None
Answer : B
17. Each pass through a loop is called a/an
A. enumeration
B. iteration
C. culmination
D. pass through
Answer : C
18. Which of the following is not true about preprocessor directives
A. They begin with a hash symbol
B. They are processed by a preprocessor
C. They form an integral part of the code
D. They have to end with a semi colon
Answer : A
19. A continue statement causes execution to skip to
A. the return 0; statement
B. the first statement after the loop
C. the statement following the continue statement
D. the next iteration of the loop
Answer : C
20. void' is a datatype.
A. True
B. False
C.
D.
Answer : A
21. The output of the following code is:
void main()
{
int a = 20;
printf("%d\t%d
", ++a, a);
}

A. 21 21
B. 20 21
C. 21 20
D. 20 20
Answer : C
22. The output of the following code is:
void main() 
{
static int a = 1, b, c;
if (a>=2) b=2; c=3;
printf("%d\t%d", b,c);
}

A. 2 3
B. 0 3
C. 0 0
D. 2 0
Answer : B
23. Nested macros are allowed.
A. True
B. False
C.
D.
Answer : B
24. Which of the following shows the correct hierarchy of arithmetic operations in C
A. / + * ?
B. * ? / +
C. + ? / *
D. * / + -
Answer : D
25. = and = = have the same operation.
A. True
B. False
C.
D.
Answer : B
26. The size of signed integer is ------ bytes.
A. 4
B. 2
C. 8
D. 10
Answer : B
27. The printf() function retunes which value when an error occurs?
A. Positive value
B. Zero
C. Negative value
D. None of these
Answer : C
28. A pointer is an indication of the variable to be accessed next.
A. True
B. False
C.
D.
Answer : B
29. A multidimensional array A[10][9] can store-------- number of elements
A. 91
B. 88
C. 90
D. 89
Answer : C
30. A declaration float a, b; occupies ___ of memory
A. 1 byte
B. 4 bytes
C. 8 bytes
D. 16 bytes
Answer : C
31. Identify the wrong statement
A. putchar(65)
B. putchar('x')
C. putchar("x")
D. putchar('
')
Answer : C
32. It is necessary to initialize the array at the time of declaration.
A. True
B. False
C.
D.
Answer : B
33. Variables declared as register storage type gets stored in CPU registers.
A. True
B. False
C.
D.
Answer : A
34. What would be the output of the following program?
int x=40;
main(){
int x=20;
printf("
%d",x);
}

A. 40
B. 20
C. Compilation Error
D. Garbeg Value
Answer : B
35. There are total ------ numbers of operators in 'C'.
A. 35
B. 45
C. 55
D. 40
Answer : B
36. The expression 'int j = 6 + 3 % -9;' evaluates to -1.
A. True
B. False
C.
D.
Answer : B
37. The output of the following code is:
main() 
{
int k, num = 30;
k = (num > 5 ? (num <= 10 ? 100 : 200) : 500);
printf("
%d", num);
}

A. 200
B. 500
C. 30
D. Unpredictable
Answer : C
38. What is an array?
A. An array is a collection of variables that are of the dissimilar data type.
B. An array is a collection of variables that are of the same data type.
C. An array is not a collection of variables that are of the same data type.
D. None of the above.
Answer : B
39. The output of the following code is:
main() 
{
int a = 5, b = 6;
(a == b? printf("%d", a));
}

A. 0
B. 5
C. Error
D. None of the above
Answer : C
40. The expression "b = 3 ^ 2;" will evaluate b = 9.
A. True
B. False
C.
D.
Answer : B
41. Which of the following is invalid?
A. ''
B. " "
C. 'a'
D. abc'
Answer : D
42. Expression 4**3 evaluates to 64.
A. True
B. False
C.
D.
Answer : B
43. emp name' is a valid variable name.
A. True
B. False
C.
D.
Answer : B
44. What's wrong? while( (i < 10) && (i > 24))
A. the logical operator && cannot be used in a test condition
B. the while loop is an exit-condition loop
C. the test condition is always true
D. the test condition is always false
Answer : D
45. The output of the following code is:
#define sqr(x= x*x) 
main()
{
int a = 10, b = 5;
printf("%d, %d", sqr(a+b),sqr(++a));
}

A. 77, 121
B. 225, 121
C. 77< 144
D. Compilation error
Answer : D
46. The identifier argv[] is a pointer to an array of strings.
A. True
B. False
C.
D.
Answer : B
47. The expression "int i = j = k = 0;" is invalid.
A. True
B. False
C.
D.
Answer : A
48. Character data types cannot be declared as unsigned.
A. True
B. False
C.
D.
Answer : B
49. Which of the following is not an infinite loop
A. int i =1;
while (1)
{i++;}
B. for( ; ; );
C. int true=0< false;
while (true)
{false = 1;}
D. int y, x = 0;
do
{y = x;}
while (x==0);
Answer : C
50. Right shifting an operand 1bit is equivalent to multiplying it by 2.
A. True
B. False
C.
D.
Answer : B

Sharing is caring