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?

593


Explain what is the difference between the expression '++a' and 'a++'?

623


What are enumerated types?

649


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.

655


Explain what is the difference between functions getch() and getche()?

601






What is static identifier?

700


Define circular linked list.

567


What are c preprocessors?

672


What are the types of c language?

551


How can I implement a delay, or time a users response, with sub-second resolution?

615


When should I declare a function?

621


Why is event driven programming or procedural programming, better within specific scenario?

1949


Write a program that accept anumber in words

1248


Explain what is meant by high-order and low-order bytes?

629


Can you assign a different address to an array tag?

695