Welcome Guest | Sign in | Register
Pointers - Discussion Page For Q.10747 | C Programming Questions and Answers | C Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > Pointers > Questions and Answers

Q: Predict the output or error(s) for the following?

main()
{
char *p;
p="%d\n";
p++;
p++;
printf(p-2,300);
}
A. 400 B. 100
C. 200 D. 300

Answer and Explanation

Answer:300

Explanation:
The pointer points to % since it is incremented twice and again decremented by 2, it points to '%d\n' and 300 is printed.

Comment on this Question

Name:

Loading...




Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved © 2012-2015 SoftLucent.