Tuesday 19 March 2013

p="%d\n";


    main()
{
char *p;
p="%d\n";
             p++;
             p++;
             printf(p-2,300);
}
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


Blog Author: Vijay Kumar

Go to: Java Aptitude


No comments:

Post a Comment