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
How is null defined in c?
How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?
What are the different data types in C?
How can I copy just a portion of a string?
List the difference between a While & Do While loops?
Why is c still so popular?
Can i use “int” data type to store the value 32768? Why?
What are loops in c?
what is the function of pragma directive in c?
pierrot's divisor program using c or c++ code
Write a program to swap two numbers without using the third variable?
can anyone suggest some site name..where i can get some good data structure puzzles???
What are the characteristics of arrays in c?
C language questions for civil engineering
What is d'n in c?