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?
Explain what is the difference between the expression '++a' and 'a++'?
What are enumerated types?
Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.
Explain what is the difference between functions getch() and getche()?
What is static identifier?
Define circular linked list.
What are c preprocessors?
What are the types of c language?
How can I implement a delay, or time a users response, with sub-second resolution?
When should I declare a function?
Why is event driven programming or procedural programming, better within specific scenario?
Write a program that accept anumber in words
Explain what is meant by high-order and low-order bytes?
Can you assign a different address to an array tag?