find the output of the following program
main()
{
int x=5, *p;
p=&x;
printf("%d",++*p);
}

Answers were Sorted based on User's Feedback



find the output of the following program main() { int x=5, *p; p=&x; prin..

Answer / guest

6

Is This Answer Correct ?    103 Yes 4 No

find the output of the following program main() { int x=5, *p; p=&x; prin..

Answer / rahul khare

6
becoz it(++*p) will evaluate like this-
1)
*(p)- gives value at this address that is 5
2)
now increment ++5
that is 6.

Is This Answer Correct ?    37 Yes 1 No

find the output of the following program main() { int x=5, *p; p=&x; prin..

Answer / lrishna

ya ans is 6.

Is This Answer Correct ?    32 Yes 7 No

find the output of the following program main() { int x=5, *p; p=&x; prin..

Answer / vignesh1988i

the answer is 6...since ++ as well as * gets the same
prority so the associativity will be right to left.. so it
will point to the value and then increment the value

Is This Answer Correct ?    23 Yes 3 No

find the output of the following program main() { int x=5, *p; p=&x; prin..

Answer / rajeesh

Six -6

Is This Answer Correct ?    15 Yes 3 No

find the output of the following program main() { int x=5, *p; p=&x; prin..

Answer / visalakshi

yes it is six

Is This Answer Correct ?    11 Yes 0 No

find the output of the following program main() { int x=5, *p; p=&x; prin..

Answer / 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

find the output of the following program main() { int x=5, *p; p=&x; prin..

Answer / ganesh auti,pune

6

Is This Answer Correct ?    6 Yes 2 No

find the output of the following program main() { int x=5, *p; p=&x; prin..

Answer / nava

TO MY KNOWLDGE
6 IS THE ANSWER

Is This Answer Correct ?    3 Yes 0 No

find the output of the following program main() { int x=5, *p; p=&x; prin..

Answer / dilip

6

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More C Interview Questions

What are the main characteristics of c language describe the structure of ac program?

0 Answers  


what is the diffrenet bettwen HTTP and internet protocol

0 Answers  


int n=1; while(1) { switch(n) { case 1:printf("a"); n++; continue; case 2:printf("b"); n++; continue; default : printf("c"); break; } break; }

1 Answers  


What is c definition?

0 Answers  


What is the proper way of these job Tell me about there full work

0 Answers   EDS,






hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..

0 Answers  


code for inverse a matrix

0 Answers  


Why is a semicolon (;) put at the end of every program statement?

0 Answers  


plz answer..... a program that reads non-negative integer and computes and prints its factorial

2 Answers  


write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1

0 Answers  


Program to swap the any two elements in an array containing N number of elements?

1 Answers   Bosch, Glenwood, Ugam Solutions,


What are the preprocessor categories?

0 Answers  


Categories