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


Please Help Members By Posting Answers For Below Questions

What is the scope of global variable in c?

546


Is null always defined as 0(zero)?

600


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?

2162


How do I use strcmp?

626


Can a pointer be null?

551






Explain the difference between structs and unions in c?

564


What is malloc and calloc?

561


How do we declare variables in c?

558


void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

1244


What is operator promotion?

615


Where can I get an ansi-compatible lint?

631


process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,

1877


What is the role of && operator in a program code?

558


What is dynamic memory allocation?

795


What does *p++ do?

576