C Language - Pointers

You Are Here :: Home > C Language > Pointers - General Questions

 
37.

#include

main()
{
struct xx
{
int x=3;
char name[]="hello";
};
struct xx *s;
printf("%d",s->x);
printf("%s",s->name);
}

A. Hello B. 3
C. 3 Hello D. Compiler Error




38.

What will be output if you will execute following code?

#include
void main(){
long array[][3]={7l,14l,21l,28l,35l,42l};
long int (*ptr)[2][3]=&array;
printf("%li",-0[1[0[ptr]]]);
return 0;
}

A. -28 B. -21
C. -14 D. -35




39.

#include
#include
int main(){
void *ptr;
printf("%d",*ptr);
return 0;
}

A. 0 B. 2
C. 4 D. Compiler error




40.

What will be output of following c program?

#include
int main(){
if(!NULL)
printf("I love profession");
else
printf("I don't love profession ");
return 0;
}

A. I love profession B. I don't love profession
C. NULL D. 1




41.

main()

{
printf("\nab");
printf("\bsi");
printf("\rha");
}

A. bai B. hai
C. sai D. nai




42.

What will be output of following c program?

#include
int main(){
int *ptr;
printf("%u\n",ptr);
printf("%d",*ptr);
return 0;
}

A. 2 B. 4
C. 6 D. Any address (Garbage value)




« previous

1

2

3

4

5

6

7

8

9

...

next »

 
 
 



© 2013 freshersindia.in ® | Copyrights | Terms & Conditions
   Designed by Freshers India
Catch Us on