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 are the data types present in c?
Can a void pointer point to a function?
What is binary tree in c?
What are the different file extensions involved when programming in C?
WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?
When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?
if p is a string contained in a string?
What is memcpy() function?
What does p mean in physics?
Is c dynamically typed?
p*=(++q)++*--p when p=q=1 while(q<=6)
What is the size of enum in bytes?
What is the scope of an external variable in c?
Explain how do you determine the length of a string value that was stored in a variable?
What are the application of void data type in c?