31.
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");
        }
}

32.
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);
}

33.
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);
}

34.
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);
}

35.
What will be the value of i and j after execution of following program?
#include<stdio.h>
void main()
{
	int i, j;
	for(i=0,j=0;i<10,j<20;i++,j++){
		printf("i=%d %t j=%d", i, j);
       }
}

36.
What will be the output given program?
#include<stdio.h>
void main()
{
	int i = -10;
	for(;i;printf("%d ", i++));
}

37.
What will be the output of the given program?
#include<stdio.h>
void main()
{
	int a=11,b=5;
	if(a=5) b++;
	printf("%d %d", ++a, b++);
}

38.
What will be the output of the given program?
#include<stdio.h>
void main()
{
      int value=0;
      if(value)
            printf("well done ");
      printf("examveda");
}

39.
What will be the output of the given program?
#include<stdio.h>
void main()
{
	int value1, value2=100, num=100;
	if(value1=value2%5) num=5;
	printf("%d %d %d", num, value1, value2);
}

40.
What will be the output of the given program?
#include<stdio.h>
void main()
{
	float num=5.6;
	switch(num){
		case 5:printf("5");
		case 6:printf("6");
		default : printf("0");
			break;

	}
	printf("%d", num);
}

Read More Section(Control Structures)

Each Section contains maximum 100 MCQs question on Control Structures. To get more questions visit other sections.