C Quiz : Basics Of C
Quiz On C Programming, Mcq's & answers of C Programming Language.
C Quiz : Basics Of C
1. What is the only function all C programs must contain?
Answer is B)
Description: main ( ) is the only function all C programs must contain.
2. What punctuation is used to signal the beginning and end of code blocks?
Answer is C)
Description: { and } punctuation is used to signal the beginning and end of code blocks in C Programs.
3. What punctuation ends most lines of C code.
Answer is A)
Description: The ; (Semicolon) punctuation ends most lines of C code?
4. Which of the following is a correct comment in C?
Answer is B)
Description: /* Comment */ is the correct comment in C.
5.Which of the following is not a correct variable type.
Answer is D)
Description: main is not a correct variable type, because main ( ) is a function.
6. Which of the following is the correct operator to compare two variables?
Answer is C)
Description: == is the correct operator to compare two variables in C.
7. What is the correct value to return to the operating system upon the successful completion of a program?
Answer is D)
Description: 0 is the correct value to return to the operating system upon the successful completion of a program.
8. Predict the output of following program?
#include <"stdio.h">
int main()
{
char CTQuiz[100];
printf("%d", scanf("%s", CTQuiz));
return 1;
}
Answer is D)
Description: In C, scanf returns the no. of inputs it has successfully read.
9. Which of the following is the boolean operator for logical-and?
Answer is D)
Description: && is the boolean operator for logical-AND.
10. Which of the following shows the correct syntax for an if statement?
Answer is C)
Description: if ( expression ) shows the correct syntax for an if statement.
Submit your Quiz Question
Submit your quiz question to us, We will feature your quiz question in our blog with your credits.
5 comments