C Language - Pointers

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

 
19.

void main()
{
int const * p=5;
printf("%d",++(*p));
}

A. 5 B. Compiler error
C. 7 D. Runtime error




20.

void main()
{
int i=5;
printf("%d",i++ + ++i);
}

A. Compile time error B. 5
C. 10 D. Output Cannot be predicted exactly




21.

What will be output of following c program?

#include
int main(){
int x=10;
int *ptr=&x; //statement one
int **temp=&ptr; //statement two
printf("%d %d %d".x.*ptr,**temp);
return 0;
}

A. 10 0 10 B. 0 10 10
C. 10 10 0 D. 10 10 10




22.

main()

{
float me = 1.1;
double you = 1.1;
if(me==you)
printf("I love U");
else
printf("I hate U");
}

A. I love U B. I hate U
C. love = hate D. None of the above




23.

#include

int main(){
int *p=(int *)1000;
int *temp;
temp=p;
p=p+2;
printf("%u %u\n",temp,p);
printf("difference=%d",p-temp);
return 0;
}

A. 1000 1000 B. 1000 1002
C. 1000 1004 D. 1002 1000




24.

main()

{
static int var = 5;
printf("%d ",var--);
if(var)
main();
}

A. 5 5 5 5 5 B. 5 4 4 4 4
C. 5 4 3 2 1 D. Compile time 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