JOIN ADRE 2.0 Telegram Group

MCQs on Conditional Statements & Loops - C Programming Multiple Choice questions with answers

Questions
6 How many times will the following loop be executed?

ch = ‘b’
while (ch > = ‘a’ && ch <= ‘z’)
A 20
B 25
C 26
D 0

Answer: Option [B]
7 Study the following ‘C’ program

#include <stdio.h>
void main ()
{ 
    int a = 7, b = 5;
    switch (a/a % b)
    { 
         case 1 : a = a-b;
         case 2 : a = a+b;
         case 3 : a = a*b;
         case 4 : a = a/b;
         default : a = a;
    } 
}

One the execution of above program, what will be the variable a?

A 2
B 5
C 7
D 12

Answer: Option [C]
Advertisement
ADRE 2.0 Mock Test - 5 Start Test
ADRE 2.0 Mock Test - 5 Start Test

DOWNLOAD CURRENT AFFAIRS PDF FROM APP

8 A switch statement is used to
A To use switching variable
B Switch between function in a programchar
C Switch from one variable to another variable
D To choose from multiple possibilities which may arise due to different values of a single variable

Answer: Option [D]
9 Study the following ‘C’ program

#include <stdio.h>
void main ()
{ 
    static a, b;
    while (a > b ++)
}

What will be the value of a and b on the execution of above program?

A a = 0, b = 1
B a = 0, b = 0
C a = 1, b = 1
D none of these

Answer: Option [A]
10 A labeled statement consist of an identifier followed by a
A ;
B ,
C :
D None of the above

Answer: Option [C]

ADRE 2.0 MOCK TEST

Take Mock Tests

Government Schemes Mock Test Start Test!
Political Science Mock Test – 42 Start Test
History Test – 190 Start Test
Quantitative Aptitude Test Start Test!
Trigonometry - Mock Test Start Test!
Data Interpretation - Mock Test Start Test!
General Awareness - Mock Test Start Test!
Reasoning Ability - Mock Test Start Test!
Englist(Antonyms) Mock Test 1 Start Test!
Quantitative Aptitude (Percentage) Mock Test Start Test!
Economy Mock Test 1 Unlock Test!
Books & Authors - Test 2 Unlock Test!

Chapters

Advertisement