1.
1. What will be
the output if you will execute following c code?
printf( "%d
%d" ,++xyz,(*( int *)xyz)--);
2.
What will be the
output if you will execute following c code?
#include <stdio.h>
int main(){
int a=0;
for (a;++a;a<=100)
printf( "%d" ,a);
return 0;
}
3.
What will be the
output if you will execute following c code?
#include <stdio.h>
int main(){
char c[6+4]= "kill
me" ;
printf( "2%s" ,c);
return 0;
}
Explanation:
Here c is array
of characters. It will store characters in the following manner:
In the printf function
variable c will return memory address of first character ‘k’ i.e. 100. As we
know %s will prints the stream of characters until it gets first null character
(‘\0’).
4.
What will be the
output if you will execute following c code?
#include <stdio.h>
int main() {
int i=0;
for (;i++;printf( "%d" ,i)) ;
printf( "%d" ,i);
return 0;
}
5.
What will be the
output if you will execute following c code?
#include <stdio.h>
int main(){
int i,j=6;
for (;i=j;j-=2)
printf( "%d" ,j);
return 0;
}
6.
State the correct statement.
I . In a while loop the control conditional check is performed n times.
II . In a do-while loop the
control conditional check is performed n+1 times.
III . break is a keyword used with if and switch case.
7.
What will be the
output if you will execute following c code?
#include <stdio.h>
int main() {
printf( "5" , "%f" ,4);
return 0;
}
8.
What happens when if will write the value in array
subscript operator which is beyond the size of array?
9.
The order of evaluation of operators having same
precedence is decided by
10.
The set of routines stored in ROM
that enable a computer to start the O.S and to communicate with the various
devices in the system is known as
11.
What will be the output if you will execute following c code?
#include <stdio.h>
struct main {
int n ;
int (* p )();
};
int main () {
struct main m;
int fun ();
m. n =fun();
m. p =fun;
(*(m. p ))();
printf( "%d" ,m. n );
return 0;
}
int fun () {
return printf( "Hello" );
}
12.
What will be the
output if you will execute following c code?
#include <stdio.h>
union spc {
int x;
int a:8;
char b:3;
};
int main () {
union spc s={260};
printf( "%d %d" , s. a ,s. b );
return 0;
}
13.
What will be the
output if you will execute following c code?
#include <stdio.h>
int main() {
goto usa;
{
static int a=10;
usa: printf( "%d" ,a);
}
return 0;
}
14.
What will be the
output if you will execute following c code?
#include <stdio.h>
int main() {
int i=3,j=2,k=1;
printf( "%d /
%d" );
return 0;
}
15.
The ‘continue’ keyword is used to
16.
Find the odd one out
17.
What is the value of EOF which is declared in
"stdio.h"?
18.
Which data type behaves like both integer type and character type?
19.
What will be the
output if you will execute following c code?
#include <stdio.h>
int main(){
struct node {
int data;
struct node *next;
};
struct node *p,*q;
p=( struct node *)malloc( sizeof ( struct node));
q=( struct node *)malloc( sizeof ( struct node));
p->data=10;
q->data=20;
p->next=q;
q->next=NULL;
printf( "%d" ,p->data);
p=p->next;
printf( "%d" ,p->data);
return 0;
}
20.
What will be the
output if you will execute following c code?
#include <stdio.h>
int main(){
int x=2,*y=&x;
printf( "%d" ,x*y);
return 0;
}
2 comments:
very helpful......thanks
IT WILL BE VERY EFFECTIVE FOR MY INTERVIEW THANKS
Post a Comment