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

How is null defined in c?

662


How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?

15532


What are the different data types in C?

737


How can I copy just a portion of a string?

827


List the difference between a While & Do While loops?

645






Why is c still so popular?

625


Can i use “int” data type to store the value 32768? Why?

764


What are loops in c?

563


what is the function of pragma directive in c?

638


pierrot's divisor program using c or c++ code

1738


Write a program to swap two numbers without using the third variable?

607


can anyone suggest some site name..where i can get some good data structure puzzles???

1653


What are the characteristics of arrays in c?

622


C language questions for civil engineering

1254


What is d'n in c?

651