Basic C Programming MCQ Questions and Answers
Practice ModeShowing 10 of 198 questions
Q41
The program fragment
int i = 263;
purchar (i);
Answer: Option C
Q42
Which of the following comments regarding the reading of a string, using scanf (with %s option) and gets, is true ?
Answer: Option C
Q43
The following statement
printf ("%f", 9/5);
prints
Answer: Option D
Q44
The statements
printf("%f", (float)9/5);
Answer: Option A
Q45
Which of the following are not keywords in C?
Answer: Option
Q46
The following program fragment
unsigned i = 1;
int j = -4;
printf("%u", i + j );
prints
Answer: Option C
Q47
If the following program fragment (assume negative numbers are stored in 2's complement form)
unsigned i = 1;
int j = -4 ;
printf "%u", i + j) ;
prints x, then printf ("%d", 8*sizeof (int));
Outputs an integer that is same as (log in the answer are to the base two)
Answer: Option C
Q48
The following statements
for (i = 3; i < 15; i += 3)
{printf ("%d", i);
++i;
will result in the printing of
Answer: Option C
Q49
If a = 9, b = 5 and c = 3, then the expression (a - a/b * b%c) > a%b%c evaluates to
Answer: Option A
Q50
In a for loop, if the condition is missing, then
Answer: Option B