C Programming MCQ with Answers Set 6

 

1. What will be output What will be the output of following code

 int main()

 { 

 int i=5; 

 i++; 

 printf("%d",i); 

 return 0; 

 }





ANSWER= (C) 6
Explain:- The output will be 6 because i++ is used , ++ means value of I will be incremented by 1

 

2. Put() is used in C language for -----------





ANSWER= (B) To print or display string
Explain:- In C language put() is used to print or display string on screen

 

3. Find error #include void main() { printf("%d%d",I,j); }





ANSWER= (C) undefined symbol I and j
Explain:- variable I and j should be declared first and then we can use for operation

 

4. What will be output of below code #include void main()

 { 

 printf("Practice test/n");

 printf("All the best"); 

 }





ANSWER= (A) Practice test/nAll the best
Explain:- Output will be :Practice test/nAll the best here forward slash an n is used so next printf statements will not be displayed on next line

 

5. The syntax of for loop is 





ANSWER= (C) initialization;testcondition;increment/decrement
Explain:- The syntax of for loop is initialization;testcondition;increment/decrement

 

6. Do while loop is used in case when statement of loop is executed------ 





ANSWER= (A) once and then test condition is checked
Explain:- do while loop is used to execute the statement once and then test condition is checked if test condition is true then iteration will takes place

 

7. -----statement is used to break the current block and jump to next block  





ANSWER= (B) break
Explain:- break statement is used to break the current statement or block and jump to next block

 

8. If statement inside if statement is called ------  





ANSWER= (C) nesting if
Explain:- The if statement inside if statement is called nesting if statement

 

9. For loop is -------loop  





ANSWER= (A) entry controlled loop
Explain:- for loop is entry controlled / top tested loop

 

10. ----- is a symbol used to perform operation or task  





ANSWER= (D) operator
Explain:- operator is a symbol which is used to perform task or operation

टिप्पणी पोस्ट करा

0 टिप्पण्या