C Language - Pointers

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

 
43.

What will be output of following c program?

#include
int *call();
void main(){
int *ptr;
ptr=call();
fflush(stdin);/div>
printf("%d",*ptr);
}
int * call(){
int x=25;
++x;
return &x;
}
A. 25 B. 35
C. Compile time error D. Garbage value




44.

#include

int main(){
int near* near * ptr;
printf("%d",sizeof(ptr),sizeof(*ptr));
return 0;
}

A. 0 2 B. 2 0
C. 2 2 D. None of these




45.

What will be output of following c program?

#include
int main(){
char huge * far *p;
printf("%d%d %d",sizeof(p),sizeof(*p),sizeof(**p));
return 0;
}

A. 2 2 2 B. 2 4 2
C. 1 4 4 D. 4 4 1




46.

main()

{
printf("%p",main);
}

A. main B. 0
C. main 0 D. Some address will be printed




47.

What will be output of following program?

#include
#include
int main(){
void (*p)();
int (*q)();
int (*r)();
p = clrscr;
q = getch;
r = puts;
(*p)();
(*r)("cquestionbank.blogspot.com");
(*q)();
return 0;
}

A. NULL B. careersadda.com
C. c D. Compilation error




48.

What will be output of following program?

#include
#include
int main(){
register a = 25;
int far *p;
p=&a;
printf("%d ",*p);
return 0;
}

A. 25 B. 4
C. Address D. Compilation error




« previous

1

2

3

4

5

6

7

8

9

...

next »

 
 
 



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