--:--









Quiz for if, if-else, nested if-else

Course: C Language | Subject: Unit 3 | Topic: Control Statements



Logo

Q1: What is the output of: if(5 > 2) printf("Yes");

Logo

Q2: Which keyword is used to test a condition in C?

Logo

Q3: In if-else, if the condition is false, which block executes?

Logo

Q4: What will be the output: if(0) printf("Hi"); else printf("Bye");

Logo

Q5: Nested if-else means?

Logo

Q6: if(3) printf("Hello"); means?

Logo

Q7: Which of these is valid if syntax?

Logo

Q8: Output: int x=5; if(x==5) printf("Equal");

Logo

Q9: Which executes when all if conditions fail in nested if-else?

Logo

Q10: if-else is an example of?

Logo

Q11: Output: if(4-4) printf("True"); else printf("False");

Logo

Q12: What is evaluated first in if condition?

Logo

Q13: Which symbol is used for equality in if condition?

Logo

Q14: Output: int a=10; if(a=5) printf("Yes"); else printf("No");

Logo

Q15: Which is true for if statement?

Logo

Q16: if(1) printf("One"); else printf("Zero"); output?

Logo

Q17: Nested if is used when?

Logo

Q18: if-else can be replaced with?

Logo

Q19: What is the output: if(2>3) printf("A"); else printf("B");

Logo

Q20: Default behavior when if condition is false and no else present?

Are you ready to start test? Set your time limit