C Language MCQ - English
What is the output of given program if user enter value 99?
#include
Home | Discussion Forum
Free Online Test
What is the output of given program if user enter value 99?
#include
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");
}
}
Answer : A
Free Online Test
View More Related Question
1) What will be the output of the following C code? #include <stdio.h>
int main()
{
int a = 1;
if (a--)
printf("True");
if (a++)
printf("False");
}
2) What will be the output of the following C code? #include <stdio.h>
int main()
{
int x = 0;
if (x == 1)
if (x >= 0)
printf("true\n");
else
printf("false\n");
}
3) How many times will the following loop be executed? ch ='b';
while(ch>='a' && ch<='z')
ch++;
4) Consider the following code fragment: for(digit=0; digit<9; digit++)
How many times the loop will be executed?
{
digit = 2*digit;
digit--;
}
5) What will be the output of the following C code? #include <stdio.h>
int main()
{
int x = 0;
if (x == 1)
if (x == 0)
printf("inside if\n");
else
printf("inside else if\n");
else
printf("inside else\n");
}