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


Please Help Members By Posting Answers For Below Questions

Which is best book for data structures in c?

599


What is scope rule in c?

606


What is a good data structure to use for storing lines of text?

599


What is wrong with this initialization?

593


Explain logical errors? Compare with syntax errors.

631






List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.

2303


How many levels of pointers can you have?

705


How do you initialize pointer variables?

614


What are the 3 types of structures?

573


Is array name a pointer?

605


What is nested structure?

574


what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)

1928


Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......

1744


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....

1525


Does c have function or method?

591