find the output of the following program
main()
{
int x=5, *p;
p=&x;
printf("%d",++*p);
}
Answer Posted / manishsoni
main()
{
int x=5, *p;
p=&x;
printf("%d",++*p);
}
it allocate as this
____ _____
x| |value p | | store &x
| 5 | | 100 |
|____| |_____|
____ _____
|100 |&x | 200 |&p p is pointer //at statement ++*p
|____| |_____|
^ ^
|________________|
and jumpt at 5 bcoz it is prefix for firstof all 5 is
increase then print
Is This Answer Correct ? | 7 Yes | 2 No |
Post New Answer View All Answers
Which is best book for data structures in c?
What is scope rule in c?
What is a good data structure to use for storing lines of text?
What is wrong with this initialization?
Explain logical errors? Compare with syntax errors.
List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.
How many levels of pointers can you have?
How do you initialize pointer variables?
What are the 3 types of structures?
Is array name a pointer?
What is nested structure?
what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)
Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......
i have to apply for the rbi for the post of officers. i need to know abt the entrance questions whether it may be aps or techinical....
Does c have function or method?