Вы находитесь на странице: 1из 3

1. Discuss about various types of iterative statements with an appropriate example.

2. Discuss multiway selection statements with proper example.


3. Write a c program to select and find area of a circle , triangle and square .
4. Differentiate between event control and counter control loop with an example.
5. Differentiate between entry control and exit control loops with an example.
6. Write a program to find a number is palindrome or not. (1221 and reverse are same).
7. Write a C program to find GCD and LCM of 2 given number.
8. Write a program to read n>5 and display the numbers till 5.
9. Write a program to read n>5 and display the numbers 1 to n except 3 .
Output: 1,2,4,5,6. If n=6

Objective
1. Rewrite the following code using one if statement.____________________________
If(achar==’E’)
C++;
If(achar==’E’)
Printf(“ the value is E\n”);
2. The value that follows the keyword CASE may only be_________________
3. The statement which is used to terminate the control from the loop is_____________

4________________is the output of the following code


#include<stdio.h>
void main()
{
int a = 2;
switch(a)
{
case 1:
printf("goodbye"); break;
case 2:
continue;
case 3:
printf("bye");
}

5. ________________is the output of the following code


#include<stdio.h>

void main()
{
if(printf("cquestionbank"))
printf("I know c");
else
printf("I know c++");
}
6. ________________is the output of the following code
#include<stdio.h>

void main(){
int i=0;
if(i==0){
i=((5,(i=3)),i=1);
printf("%d",i);
}
else
printf("equal");
}

7.________________is the output of the following code


#include<stdio.h>
void main()
{
int a=10,b=20;
char x=1,y=0;
if(a,b,x,y)
{
printf("EXAM");
}
}
8.________________is the output of the following code
#include<stdio.h>
void main()
{
int s=0;
while(s++<10)
{
if(s<4 && s<9)
continue;
printf("\n%d\t",s);
}
}

9. The loop in which the statements within the loop are executed at least once is called____-___
10. Which keyword is used to come out of a loop only for that iteration is__________________?
11. ____________is The output of the code below is

#include <stdio.h>
int x;
void main()
{
if (x)
printf("hi");
else
printf("how are u");
}
12. Comment on the following code below___________________

#include <stdio.h>
void main()
{
int x = 5;
if (true);
printf("hello");
}
13. The output of the code below is______________________

#include <stdio.h>
void main()
{
int x = 0;
if (x == 0)
printf("hi");
else
printf("how are u");
printf("hello");
}
14. The output of the code below is_________________

#include <stdio.h>
void main()
{
int x = 5;
if (x < 1);
printf("Hello");

}
15. The output of the code below is_________________
#include <stdio.h>
int main()
{
int i = 3;
switch (i)
{
case 0+1: printf("Geeks");
break;
case 1+2: printf("Quiz");
break;
default: printf("GeeksQuiz");
}
return 0;
}

Вам также может понравиться