find the output of the following program
main()
{
int x=5, *p;
p=&x;
printf("%d",++*p);
}
Answer Posted / 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 |
Post New Answer View All Answers
What is context in c?
Can I initialize unions?
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].
What is the default value of local and global variables in c?
What is 02d in c?
What is c language in simple words?
Is there a way to compare two structure variables?
Is null valid for pointers to functions?
exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above
What is a buffer in c?
What are the advantages of using linked list for tree construction?
write a programming in c to find the sum of all elements in an array through function.
Write a program with dynamically allocation of variable.
What is wrong with this initialization?
What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers