C Programming Code Snippets For Competitive Exams
1. Find the output
void main()
{
printf(”%d”);
}
2. What is output ?
main()
{
printf(5+”learner india);
}
3. Find out put
void main()
{
int success();
int (*sun)();
sun = success;
(*sun)();
printf(“%d”,(*sun)());
}
int success()
{
printf(“Hello”);
return (3.33);
}
4. Find output
Aaa()
{
printf(“Hi”);
}
Bbb()
{
printf(“Hello”);
}
Ccc()
{
printf(“Bye”);
}
void main()
{
int (*ptr[3])();
ptr[0] = Aaa;
ptr[1] = Bbb;
ptr[2] = Ccc;
ptr[2]();
}
5.
struct temp
{
int a;
struct temp no_roll;
double c;
}obj;
6.
int takefirst(int a,int b,int c)
{
return (++a,b+2,c);
}
void main( )
{
static int m,n;
m = takefirst(n,m,n);
printf(“%d”,m);
}
7. Find output of fallowing program
void main()
{
printf("Today r is a7 great tr\day");
}
8. What is output ?
void main( )
{
int i=107,x=5;
printf((x>7)?”%d”:”%c”,i);
}
9. If a=-11 and b=-3 what is the value of a%b?
10. Find output
int show(int v)
{
if(v= =1||v= =0)
return 1;
if(v % 2==0)
return show(v/2) +2;
else
return show(v-2) +3;
}
void main( )
{
int z;
z = show(7);
printf(“%d”,z);
}
Learn More Multiple Choice Practice Questions
All Categories