What will be the output of
x++ + ++x?
Answer Posted / shashi shekhar
In this type of question the operation done from right side of the expression.Here we can see two types of increments pre and post increment,in post first the value assigned then increment but in pre first the value is incressed then the value assigned.
For example if x is initialized with a value
"1" then the this expression gives the output "4".
Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
What is the scope of global variable in c?
Is null always defined as 0(zero)?
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?
How do I use strcmp?
Can a pointer be null?
Explain the difference between structs and unions in c?
What is malloc and calloc?
How do we declare variables in c?
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
What is operator promotion?
Where can I get an ansi-compatible lint?
process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,
What is the role of && operator in a program code?
What is dynamic memory allocation?
What does *p++ do?