1.
What will be output if you will execute following c code?
#include <stdio.h>
void main(){
char arr[7]= "Network" ;
printf( "%s" ,arr);
}
2.
What will be output if you will execute following c code?
#include <stdio.h>
void main(){
char arr[11]= "The
African Queen" ;
printf( "%s" ,arr);
}
3.
What will be output if you will execute following c code?
#include <stdio.h>
void main(){
char arr[20]= "MysticRiver" ;
printf( "%d" , sizeof (arr));
}
4.
What will be output if you will execute following c code?
#include <stdio.h>
void main(){
int const SIZE=5;
int expr;
double
value[SIZE]={2.0,4.0,6.0,8.0,10.0};
expr=1|2|3|4;
printf( "%f" ,value[expr]);
}
5.
What will be output if you will execute following c code?
#include <stdio.h>
enum power{
Dalai,
Vladimir=3,
Barack,
Hillary
};
void main (){
float
leader[Dalai+Hillary]={1.f,2.f,3.f,4.f,5.f};
enum power p=Barack;
printf( "%0.f" ,leader[p>>1+1]);
}
6.
What will be output if you will execute following c code?
#include <stdio.h>
#define var 3
void main(){
char
*cricket[var+~0]={ "clarke" , "kallis" };
char
*ptr=cricket[1+~0];
printf( "%c" ,*++ptr);
}
7.
What will be output if you will execute following c code?
#include <stdio.h>
#define var 3
void main(){
char data[2][3][2]={0,1,2,3,4,5,6,7,8,9,10,11};
printf( "%o" ,data[0][2][1]);
}
8.
What will be output if you will execute following c code?
#include <stdio.h>
#define var 3
void main(){
short
num[3][2]={3,6,9,12,15,18};
printf( "%d %d" ,*(num+1)[1],**(num+2));
}
9.
What will be output if you will execute following c code?
#include <stdio.h>
#define var 3
void main(){
char *ptr= "cquestionbank" ;
printf( "%d" ,-3[ptr]);
}
10.
What will be output if you will execute following c code?
#include <stdio.h>
void main(){
long myarr[2][4]={0l,1l,2l,3l,4l,5l,6l,7l};
printf( "%ld\t" ,myarr[1][2]);
printf( "%ld%ld\t" ,*(myarr[1]+3),3[myarr[1]]);
printf( "%ld%ld%ld\t"
,*(*(myarr+1)+2),*(1[myarr]+2),3[1[myarr]]);
}
11.
What will be output if you will execute following c code?
#include <stdio.h>
void main(){
int
array[2][3]={5,10,15,20,25,30};
int
(*ptr)[2][3]=&array;
printf( "%d\t" ,***ptr);
printf( "%d\t" ,***(ptr+1));
printf( "%d\t" ,**(*ptr+1));
printf( "%d\t" ,*(*(*ptr+1)+2));
}
12.
What will be output if you will execute following c code?
#include <stdio.h>
void main(){
static int a=2,b=4,c=8;
static int
*arr1[2]={&a,&b};
static int
*arr2[2]={&b,&c};
int *
(*arr[2])[2]={&arr1,&arr2};
printf( "%d
%d\t" ,*(*arr[0])[1],
*(*(**(arr+1)+1)));
}
13.
What will be output if you will execute following c code?
#include <stdio.h>
#include <math.h>
double myfun( double );
void main (){
double (*array[3])( double );
array[0]=exp;
array[1]=sqrt;
array[2]=myfun;
printf( "%.1f\t" ,(*array)((*array[2])((**(array+1))(4))));
}
double myfun ( double d){
d-=1;
return d;
}
14.
What will be output if you will execute following c code?
#include <stdio.h>
#include <math.h>
typedef struct {
char *name;
double salary;
}job;
void main (){
static job a={ "TCS" ,15000.0};
static job b={ "IBM" ,25000.0};
static job c={ "Google" ,35000.0};
int x=5;
job
* arr[3]={&a,&b,&c};
printf( "%s %f\t" ,(3,x>>5-4)[*arr]);
}
double myfun ( double d){
d-=1;
return d;
}
15.
What will be output if you will execute following c code?
#include <stdio.h>
union group{
char xarr[2][2];
char yarr[4];
};
void main (){
union group x={ 'A' , 'B' , 'C' , 'D' };
printf( "%c" ,x. xarr [x. yarr [2]-67][x. yarr [3]-67]);
}
16.
What will be output if you will execute following c code?
#include <stdio.h>
void main(){
int a=5,b=10,c=15;
int *arr[3]={&a,&b,&c};
printf( "%d" ,*arr[*arr[1]-8]);
}
17.
What will be output if you will execute following c code?
#include <stdio.h>
void main(){
int
arr[][3]={{1,2},{3,4,5},{5}};
printf( "%d %d
%d" , sizeof (arr),arr[0][2],arr[1][2]);
}
18.
What will be output if you will execute following c code?
#include <stdio.h>
void main(){
int xxx[10]={5};
printf( "%d
%d" ,xxx[1],xxx[9]);
}
19.
What will be output if you will execute following c code?
#include <stdio.h>
#define WWW -1
enum {cat,rat};
void main (){
int Dhoni[]={2, 'b' ,0x3,01001, '\x1d' , '\111' ,rat,WWW};
int i;
for (i=0;i<8;i++)
printf( "
%d" ,Dhoni[i]);
}
20.
What will be output if you will execute following c code?
#include <stdio.h>
void main(){
long double a;
signed char b;
int arr[ sizeof (!a+b)];
printf( "%d" , sizeof (arr))
}
2 comments:
Madherchod
explaination tmhare papa denge
Post a Comment