C Programming - Input / Output - Discussion

Discussion Forum : Input / Output - Find Output of Program (Q.No. 8)
8.
What will be the output of the program ?
#include<stdio.h>

int main()
{
    char *p;
    p="%d\n";
    p++;
    p++;
    printf(p-2, 23);
    return 0;
}
21
23
Error
No output
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
25 comments Page 2 of 3.

Nidipa said:   9 years ago
Please can any one explain clearly? I didn't understand this program.

Dakshya said:   1 decade ago
But this program doesn't say that pointer is now pointing on 23.

Sagar said:   1 decade ago
Paresh has given a good explanation for beginers like me.

Mukesh kumar said:   1 decade ago
Chaudhary paresh answer is simple and correct.

SALAMUDDIN said:   9 years ago
You're absolutely right @Priyanka.

Vijji said:   1 decade ago
Chaudhary Paresh answer is simple.

Yuvaraj said:   2 decades ago
Can anyone explain this problem?

Ravi rathore said:   9 years ago
Nice explanation @Priyanka.

Piyush said:   1 decade ago
Sharaths answer is simple.

Basha said:   8 years ago
Please explain me clearly.


Post your comments here:

Your comments will be displayed after verification.