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);
}
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);
}
What will be the following code's output if choice = 'R'?
switch(choice)
{
case 'R' : printf("RED");
case 'W' : printf("WHITE");
case 'B' : printf("BLUE");
default : printf("ERROR");break;
}
What will be the following code's output if choice = 'R'?
switch(choice)
{
case 'R' : printf("RED");
case 'W' : printf("WHITE");
case 'B' : printf("BLUE");
default : printf("ERROR");break;
}
The type of the controlling expression of a switch statement cannot be of the type ........
The type of the controlling expression of a switch statement cannot be of the type ........
Consider the following program fragment:
for(c=1, sum=0; c <= 10; c++)
{
scanf("%d", &x);
if( x < 0 ) continue;
sum += x;
}
What would be the value of sum for the input 1, -1, 2, -2, 3, -3, 4, -4, 5, -5
Consider the following program fragment:
for(c=1, sum=0; c <= 10; c++)
{
scanf("%d", &x);
if( x < 0 ) continue;
sum += x;
}
What would be the value of sum for the input 1, -1, 2, -2, 3, -3, 4, -4, 5, -5
What's wrong in the following statement, provided k is a variable of type int?
for(k = 2, k <=12, k++)
What's wrong in the following statement, provided k is a variable of type int?
for(k = 2, k <=12, k++)
What will be the output of given program?
#include<stdio.h>
void main()
{
int a=3;
for(;a;printf("%d ", a--);
}
What will be the output of given program?
#include<stdio.h>
void main()
{
int a=3;
for(;a;printf("%d ", a--);
}
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);
}
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);
}
What will be the final value of the digit?
void main()
{
int digit = 0;
for( ; digit <= 9; )
digit++;
digit *= 2;
--digit;
}
What will be the final value of the digit?
void main()
{
int digit = 0;
for( ; digit <= 9; )
digit++;
digit *= 2;
--digit;
}
What will be the output given program?
#include<stdio.h>
void main()
{
int i = -10;
for(;i;printf("%d ", i++));
}
What will be the output given program?
#include<stdio.h>
void main()
{
int i = -10;
for(;i;printf("%d ", i++));
}
Consider the following code:
void main()
{
int a[5] = {6,8,3,9,0}, i=0;
if(i != 0)
{
break;
printf("%d", a[i]);
}
else
printf("%d", a[i++]);
}
What is the output of the above program?
Consider the following code:
void main()
{
int a[5] = {6,8,3,9,0}, i=0;
if(i != 0)
{
break;
printf("%d", a[i]);
}
else
printf("%d", a[i++]);
}
What is the output of the above program?
What will be the output of given program?
#include<stdio.h>
void main()
{
int a=1;
if("%d=hello", a);
}
What will be the output of given program?
#include<stdio.h>
void main()
{
int a=1;
if("%d=hello", a);
}
What will be the output of the given program?
#include<stdio.h>
void main()
{
int value=0;
if(value)
printf("well done ");
printf("examveda");
}
What will be the output of the given program?
#include<stdio.h>
void main()
{
int value=0;
if(value)
printf("well done ");
printf("examveda");
}
Which command is used to skip the rest of a loop and carry on from the top of the loop again?
Which command is used to skip the rest of a loop and carry on from the top of the loop again?
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 a=11,b=5;
if(a=5) b++;
printf("%d %d", ++a, b++);
}
What will be the output of the following code?
#include
void main()
{
int s=0;
while(s++<10)
{
if(s<4 && s<9)
continue;
printf("%dt", s);
}
}
What will be the output of the following code?
#include
void main()
{
int s=0;
while(s++<10)
{
if(s<4 && s<9)
continue;
printf("%dt", s);
}
}
What is the right choice, if the following loop is implemented?
void main()
{
int num = 0;
do{
--num;
printf("%d", num);
}while( ++num >= 0 );
}
What is the right choice, if the following loop is implemented?
void main()
{
int num = 0;
do{
--num;
printf("%d", num);
}while( ++num >= 0 );
}
What is the output of the following program?
#include<stdio.h>
int c[10] = {1,2,3,4,5,6,7,8,9,10};
main()
{
int a, b=0;
for(a=0;a<10;++a)
if(c[a]%2 == 1)
b+=c[a];
printf("%d", b);
}
What is the output of the following program?
#include<stdio.h>
int c[10] = {1,2,3,4,5,6,7,8,9,10};
main()
{
int a, b=0;
for(a=0;a<10;++a)
if(c[a]%2 == 1)
b+=c[a];
printf("%d", b);
}
Find the output of the following program.
#include<stdio.h>
void main()
{
int y=10;
if(y++>9 && y++!=10 && y++>11)
printf("%d", y);
else
printf("%d", y);
}
Find the output of the following program.
#include<stdio.h>
void main()
{
int y=10;
if(y++>9 && y++!=10 && y++>11)
printf("%d", y);
else
printf("%d", y);
}
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);
if(i%5 == 0){
printf("nNumber entered is divisible by 5");
}
}
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);
if(i%5 == 0){
printf("nNumber entered is divisible by 5");
}
}
What will be printed if the following code is executed?
void main()
{
int x=0;
for( ; ; )
{
if( x++ == 4 ) break;
continue;
}
printf("x=%d", x);
}
What will be printed if the following code is executed?
void main()
{
int x=0;
for( ; ; )
{
if( x++ == 4 ) break;
continue;
}
printf("x=%d", x);
}
What is the output of the following statements?
for(i=10; i++; i<15)
printf("%d ", i);
What is the output of the following statements?
for(i=10; i++; i<15)
printf("%d ", i);
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);
}
}
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);
}
}
What will be the output of the following piece of code?
for(i = 0; i<10; i++);
printf("%d", i);
What will be the output of the following piece of code?
for(i = 0; i<10; i++);
printf("%d", i);
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 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 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 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 of given program?
#include<stdio.h>
void main()
{
int i=1, j=-1;
if((printf("%d", i)) < (printf("%d", j)))
printf("%d", i);
else
printf("%d", j);
}
What will be the output of given program?
#include<stdio.h>
void main()
{
int i=1, j=-1;
if((printf("%d", i)) < (printf("%d", j)))
printf("%d", i);
else
printf("%d", j);
}
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 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 value of sum after the following program is executed?
void main()
{
int sum=1, index = 9;
do{
index = index – 1;
sum *= 2;
}while( index > 9 );
}
What will be the value of sum after the following program is executed?
void main()
{
int sum=1, index = 9;
do{
index = index – 1;
sum *= 2;
}while( index > 9 );
}