What are the two types of control structures?
Selection and loops.
What are the different types of selection?
if statement, switch statement, conditional operator
What are the three kinds of loops?
while loop, do while loop and for loop.
Give an example of a switch statement.
int x = 2;
switch (x)
{
case 1: printf("Choice is 1");
break;
case 2: printf("Choice is 2");
break;
case 3: printf("Choice is 3");
break;
default: printf("Choice other than 1, 2 and 3");
break;
}Give an example of a do while loop.
do{
printf(“%d \n”,i);
i++;
}while(i<=10);