## Lakshya Education MCQs

Question: 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");
}
}
Options:
 A. Enter a number:99 B. Enter a number:99 Number is divisible by 5 C. complier error D. Run time error

Earn Reward Points by submitting Detailed Explaination for this Question

## More Questions on This Topic :

Question 1. What is the output of given program if user enter "xyz" ?
#include
void main()
{
float age, AgeInSeconds;
int value;
value=scanf("%f", &age);
if(value==0){
}
AgeInSeconds = 365 * 24 * 60 * 60 * age;
printf("\\n You have lived for %f seconds", AgeInSeconds);
}
2.    Enter your age: xyz You have lived for 0 seconds
4.    Complier error
Question 2. What is the output of given program if user enter "xyz" ?
#include
void main()
{
float age, AgeInSeconds;
scanf("%f", &age);
AgeInSeconds = 365 * 24 * 60 * 60 * age;
printf("You have lived for %f seconds", AgeInSeconds);
}
1.    Enter your age: xyz You have lived for 0 seconds
2.    Enter your age: xyz You have lived for 0.00000 seconds
3.    Enter your age: xyz "after that program will stop"
4.    Run time error
Question 3. What will be the output of the given program?
#include
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);
}
1.    10 10 11 11
2.    10 20 21 21
3.    10 20 21 10
4.    10 20 21 20