What will be the output of the following code?
#include<stdio.h>
void main()
{
int s=0;
while(s++<10)
{
if(s<4 && s<9)
continue;
printf("%dt", s);
}
}
#include<stdio.h>
void main()
{
int s=0;
while(s++<10)
{
if(s<4 && s<9)
continue;
printf("%dt", s);
}
}
A. 1 2 3 4 5 6 7 8 9
B. 1 2 3 10
C. 4 5 6 7 8 9 10
D. 4 5 6 7 8 9
E. None of these
Answer: Option C
Solution(By Examveda Team)
'If' statement only true when value of 's' is less then 4Join The Discussion
Comments ( 6 )
Related Questions on Control Structures
Which control structure is used to repeatedly execute a block of code in C?
A. for loop
B. if statement
C. switch case
D. while loop
In C, what is the purpose of the 'break' statement within a loop?
A. Continue to the next iteration
B. Exit the program
C. Terminate the loop and exit it
D. Skip the current iteration
What is the purpose of the 'else' statement in C's 'if-else' control structure?
A. Execute the 'if' block
B. Execute the 'else' block
C. Execute both 'if' and 'else' blocks
D. Skip the 'if' block
Which control structure is used to make a decision between two or more alternatives in C?
A. switch case
B. for loop
C. if statement
D. while loop
in case of 0,1,2 and three why it is not printed cant understand
Hello Guys Solution of the above question is update. Please check it.
Guys please tell me how is it possible??
i think the answer will be d because of the presence f break it will again go to the continue and ultimately it will hang
How is the output
Ans is d not c becz when s =10 condition will be false so while loop will not execute