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
What is spark map function?
Should I learn c before c++?
Can we declare function inside main?
What is s in c?
What are structural members?
What are header files in c programming?
How do you sort filenames in a directory?
Differentiate between a for loop and a while loop? What are it uses?
What is the difference between %d and %i?
What is #include cctype?
Is null always defined as 0(zero)?
What is || operator and how does it function in a program?
How will you find a duplicate number in a array without negating the nos ?
What is a program?
What does %c do in c?