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);
}
What is the output of given program if user enter "xyz" ?
#include
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);
}
1 Crore+ students have signed up on EduRev. Have you? Download the App |
What will be the output of the given program?
#include<stdio.h>
void main()
{
int value=0;
if(value)
printf("well done ");
printf("Edurev");
}
What is the output of given program if user enter "xyz" ?
#include
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);
}
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++);
}
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);
}
What will be the output given program?
#include<stdio.h>
void main()
{
int i = -10;
for(;i;printf("%d ", i++));
}
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");
}
}
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 j=%d\n", i, j);
}
}
What will be the output of the given program?
#include
void main()
{
float num=5.6;
switch(num){
case 5:printf("5");
case 6:printf("6");
default : printf("0");
break;
}
printf("%d", num);
}