Professional Documents
Culture Documents
Following quiz provides Multiple Choice Questions (MCQs) related to C Programming Framework. You will have to read all the given
answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer
button. You can use Next Quiz button to check new set of questions in the quiz.
#include<stdio.h>
main()
{
int const a = 5;
a++;
printf(%d,a);
}
A-5
B-6
C - Runtime error
D - Compile error
Show Answer
#include<stdio.h>
union abc {
char a,b,c,d,e,f,g,h;
int i;
}abc;
main()
{
printf( "%d", sizeof( abc ));
}
A-1
B-2
C-4
D-8
https://www.tutorialspoint.com/cprogramming/cprogramming_online_quiz.htm 1/4
9/5/2017 C Programming Online Quiz - TutorialsPoint
Show Answer
Q 3 - Following is the invalid inclusion of a file to the current program. Identify it.
A - #include <file>
B - #include file
Show Answer
Q 4 - Does both the loops in the following programs prints the correct string length?
#include<stdio.h>
main()
{
int i;
char s[] = "hello";
i=0;
while(s[i++]);
printf("%d ", i);
}
Show Answer
#include<stdio.h>
main()
{
printf("%d", !0<2);
}
A-0
B-1
C - False
D - True
Show Answer
Q 6 - In C, what are the various types of real data type (floating point data type)?
Show Answer
https://www.tutorialspoint.com/cprogramming/cprogramming_online_quiz.htm 2/4
9/5/2017 C Programming Online Quiz - TutorialsPoint
A - ((((a+m)+n)+o)+p)
B - *(*(*(*(a+i)+j)+k)+2)
C - *( (((a+m)+n)+o+p)
D - *( ((a+m)+n+o+p)
Show Answer
Q 8 - In the given below code, the function fopen()uses "r" to open the file source.txt in binary mode for which purpose?
#include<stdio.h>
int main ()
{
FILE *fp;
fp = fopen("source.txt", "r");
return 0;
}
A - For reading
Show Answer
Q 9 - During preprocessing, the code #include<stdio.h> gets replaced by the contents of the file stdio.h.
A - Yes
Show Answer
Q 10 - If, the given below code finds the length of the string then what will be the length?
#include<stdio.h>
while(*s!='\0')
{length++; s++;}
return (length);
}
int main()
{
char d[] = "IndiaMAX";
Show Answer
Questions Page
https://www.tutorialspoint.com/cprogramming/cprogramming_online_quiz.htm Next Quiz 3/4
9/5/2017 C Programming Online Quiz - TutorialsPoint
Advertisements
https://www.tutorialspoint.com/cprogramming/cprogramming_online_quiz.htm 4/4