C Language - Pointers

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

 
49.

What will be output of following program?

#include
int main(){
int a = 10;
void *p = &a;
int *ptr = p;
printf("%u",*ptr);
return 0;
}

A. 10 B. Address
C. 2 D. Compilation error




50.

void main()

{
char far *farther,*farthest;
printf("%d..%d",sizeof(farther),sizeof(farthest));
}

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




51.

What will be output of following program?

#include
#include
int main(){
char *ptr1 = NULL;
char *ptr2 = 0;
strcpy(ptr1," g");
strcpy(ptr2,"shalini");
printf("\n%s %s",ptr1,ptr2);
return 0;
}

A. g shalini B. g (null)
C. (null) (null) D. Run time error




52.

main()

{
char *p;
p="Hello";
printf("%c\n",*&*p);
}

A. Hello B. ello
C. H D. E




53.

#include

main()
{
char s[]={'a','b','c','\n','c','\0'};
char *p,*str,*str1;
p=&s[3];
str=p;
str1=s;
printf("%d",++*p + ++*str1-32);
}

A. 37 B. 47
C. 57 D. 77




54.

What will be output when you will execute following c code?

#include
void main(){
char *ptr="cquestionbank";
printf("%d",-3[ptr]);
}

A. Garbage value B. -300
C. -103 D. Compilation error




« previous

1

2

3

4

5

6

8

9

...

next »

 
 
 



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