C-Control Instructions Questions and Answers

Practice Mode
Showing 10 of 24 questions
Q1
How many times the while loop will get executed if a short int is 2 byte wide? #include<stdio.h> int main() {     int j=1;     while(j <= 255)     {         printf("%c %d\n", j, j);         j++;     }     return 0; }
  • A Infinite times
  • B 255 times
  • C 256 times
  • D 254 times
Answer: Option B
Q2
Which of the following is not logical operator?
  • A &
  • B &&
  • C ||
  • D !
Answer: Option A
Q3
In mathematics and computer programming, which is the correct order of mathematical operators ?
  • A Addition, Subtraction, Multiplication, Division
  • B Division, Multiplication, Addition, Subtraction
  • C Multiplication, Addition, Division, Subtraction
  • D Addition, Division, Modulus, Subtraction
Answer: Option B
Q4
Which of the following cannot be checked in a switch-case statement?
  • A Character
  • B Integer
  • C Float
  • D enum
Answer: Option C
Q5
What is the purpose of a control instruction in C programming?
  • A To declare variables
  • B To perform mathematical calculations
  • C To control the flow of program execution
  • D To define functions
Answer: Option C
Explanation: Control instructions determine the flow of program execution by making decisions and looping.
Q6
Which loop is guaranteed to execute at least once in C?
  • A for loop
  • B while loop
  • C do-while loop
  • D if-else statement
Answer: Option C
Explanation: Do-while loop checks condition after execution, ensuring at least one iteration.
Q7
What is the output of: for(i=0;i<3;i++) printf("%d",i);
  • A 012
  • B 123
  • C 0123
  • D 1234
Answer: Option A
Explanation: Loop runs for i=0,1,2 and prints each value.
Q8
Which statement is used to terminate a loop immediately in C?
  • A exit
  • B break
  • C continue
  • D return
Answer: Option B
Explanation: Break statement exits the loop immediately without completing remaining iterations.
Q9
What does the continue statement do in a loop?
  • A Terminates the loop
  • B Skips current iteration and continues with next
  • C Exits the program
  • D Restarts the loop from beginning
Answer: Option B
Explanation: Continue skips the current iteration and moves to the next iteration of the loop.
Q10
Which is an entry-controlled loop in C?
  • A do-while loop
  • B while loop
  • C Both while and do-while
  • D for loop only
Answer: Option B
Explanation: While loop checks condition before entering the loop body.
Questions and Answers for Competitive Exams Various Entrance Test