No student devices needed. Know more
10 questions
#include<stdio.h>
int main()
{
int num=1; //initializing the variable
while(num<=10) //while loop with condition
{
printf("%d\n",num);
num++; //incrementing operation
}
return 0;
}
1 2 3 4 5 6 7 8 9 10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
1 2 3 4 5 6 7 8 9
4) What will be the output of following program ?
#include < stdio.h >
int main()
{
int tally=0;
for(;;)
{
if(tally==10)
break;
printf("%d ",++tally);
}
return 0;
}
0 1 2 3 4 5 6 7 8 9 10
0 1 2 3 ... infinite times
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9
The continue statment cannot be used with
for
while
do...while
switch
Which of the following is an invalid if-else statement?
if (if (a == 1)){}
if (a){}
if ((char) a){}
if (func1 (a)){}
How many times i value is checked in the below code?
int main()
{
int i = 0;
do {
i++;
printf("in while loop\n");
} while (i < 3);
}
2
3
4
1
What will be the output of following program?
13
12
10
15
What will be the output of following program?
0 1 2 3
0 1 2 3 4
1 2 3 4
1 2 3
What will be the output of following program?
0 1 2 3 4 5 6 7 8 9 10
0 1 2 3 ... infinite time
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9
What will be an output if option="H"?
Hello
Hello Welcome
Hello Welcome Bye
Bye
What will be the output of following program
5
4
5 4
3 4 5
3
4
5
Explore all questions with a free account