Question 1 of 25
Hints left: 3
Q1
Which control structure is used to execute a block of code only if a condition is true in C?
Q2
How can you create an infinite loop in C?
Q3
Which control structure is used to execute a block of code repeatedly as long as a condition is true in C?
Q4
In C, which statement is used to exit the current iteration of a loop and continue with the next iteration?
Q5
What does the 'default' case in a 'switch' statement do in C?
Q6
In C, what is the purpose of the 'goto' statement?
Q7
What happens if a 'break' statement is used within a 'switch' statement in C?
Q8
Which control structure in C is used to perform a repetitive task while a condition is true?
Q9
What is the purpose of the 'if' control structure in C?
Q10
What is the output of given program if user enter "xyz" ? #include<stdio.h> void main() { float age, AgeInSeconds; int value; printf("Enter your age:"); value=scanf("%f", &age); if(value==0){ printf("\\nYour age is not valid"); } AgeInSeconds = 365 * 24 * 60 * 60 * age; printf("\\n You have lived for %f seconds", AgeInSeconds); }
Q11
What is the result of the expression 1 && 1 in C?
Q12
What is the result of the expression `3 || 0` in C?
Q13
In C, which control structure is used to execute a block of code a specific number of times?
Q14
What will be the output of the given program? #include<stdio.h> void main() { int i=10; printf("i=%d", i); { int i=20; printf("i=%d", i); i++; printf("i=%d", i); } printf("i=%d", i); }
Q15
What is the result of the expression !0 in C?
Q16
What is the purpose of the 'return' statement in C?
Q17
What is the result of the expression `7 || 0` in C?
Q18
In C, what happens if the 'break' statement is used outside of a loop or switch statement?
Q19
What is the output of given program if user enter value 99? #include<stdio.h> void main() { int i; printf("Enter a number:"); scanf("%d", &i); // 99 is given as input. if(i%5 == 0){ printf("nNumber entered is divisible by 5"); } }
Q20
In C, which control structure allows you to define a block of code to be executed in response to a specific event or condition?
Q21
What is the result of the expression 2 && 0 in C?
Q22
What is the output of given program if user enter "xyz" ? #include<stdio.h> void main() { float age, AgeInSeconds; printf("Enter your age:"); scanf("%f", &age); AgeInSeconds = 365 * 24 * 60 * 60 * age; printf("You have lived for %f seconds", AgeInSeconds); }
Q23
What is the purpose of the 'switch' statement in C?
Q24
What is the result of the expression 10 % 3 in C?
Q25
In C, which control structure is used to iterate through a collection of items, such as an array or a list?