Note 1

Take Note:

Take a note while surfing.





Note With Ink

Give your Note a Colorful Tag.




Easy to Access

Stay on same information and in Sync wherever you are.

Note 2

Take Note:

Organize your information,It may take Shape.





Think With Ink

Differ your Content by Color.




Easy to Access

Easy to pull up your content from anywhere anytime.

Note 3

Take Note:

Don't Let information to miss,Because it take shape





Note With Ink

Simple an Easy Way to take a note.




Easy to Access

Get the same in next visit.

C Programming :: Pointers

Home > C Programming > Pointers > General Questions

21. What will be output of the following "c" code?

#include
void main()
{
int a=2,*f1,*f2;
f1=f2=&a;
*f2+=*f2+=a+=2.5;
printf("\n%d %d %d",a,*f1,*f2);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option C

Explanation:

f1 and f2 both refer to the same memory location a.
So changes through f1 and f2 ultimately affects only the value of a.

Workspace

Tags:

No Tags on this question yet!

22. What will be output of the following "c" code?

#include
void main()
{
int i = 257;
int *iPtr = &i;
printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) );
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option A

Explanation:

The integer value 257 is stored in the memory as, 00000001 00000001, so the individual bytes are taken by casting it to char * and get printed.

Workspace

Tags:

No Tags on this question yet!

23. What will be output of the following "c" code?

#include
void main()
{
int i = 258;
int *iPtr = &i;
printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) );
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

24. What will be output of the following "c" code?

#include
void main()
{
char * str = "hello";
char * ptr = str;
char least = 127;
while (*ptr++)
least = (*ptr printf("%d",least);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option D

Explanation:

After 'ptr' reaches the end of the string the value pointed by 'str' is '\0'. So the value of 'str' is less than that of 'least'. So the value of 'least' finally is 0.

Workspace

Tags:

No Tags on this question yet!

25. What is the output of the following 'C' program ?

#include
int main()
{
int a = 10,*j;
void *k;
j = &a;
k = &a;
*j++;
printf("%d",*j);
printf("%d" ,*k);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

26. What is the output of the following 'C' program ?

#include
enum {FALSE,TRUE};
int main()
{
int i=1;
do
{
printf("%d\n",i);
i++;
if(i < 5) continue; else
i = 4;
}while(TRUE);
return 0;
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

27. The size of generic pointer in c is 2 __

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

Tags:

nagarro 

28. What will be output of the following "c" code?

#include
void main() {
char *p;
p = "Hello";
printf("%c", *&*p);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

29.  What will be output of the following "c" code?

#include
void main()
{
char *p= "Hai Friends", *p1;
p1= p;
while(*p != '\0')
++*p++;
printf("%s %s ", p, p1);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

30. The following C program fragment

void main()
{
int *a;
*a= 7;
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!