What will be the output of
x++ + ++x?
Answer Posted / naveenkumari
here we can see two types of increments pre and post
increment . since x++ is post increment first the value is
assigned and then increments but in case of ++x first the
value is incremented and then assigned since x is not
initialized with any value the above expression gives a
garbage value .For example if x is initialized with a value
"1" then the this expression gives the output as "3"
| Is This Answer Correct ? | 4 Yes | 4 No |
Post New Answer View All Answers
What are valid operations on pointers?
What does the c in ctime mean?
What is the use of in c?
What is static and volatile in c?
Differentiate between declaring a variable and defining a variable?
How do you sort filenames in a directory?
Explain can static variables be declared in a header file?
Explain indirection?
Explain 'far' and 'near' pointers in c.
What does *p++ do?
Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?
What is your stream meaning?
Is it fine to write void main () or main () in c?
What is the difference between a function and a method in c?
What does p mean in physics?