Electronics and Communication Engineering - Microprocessors - Discussion
Discussion Forum : Microprocessors - Section 4 (Q.No. 16)
16.
Consider the following expressions in Java
Now the values of a, b, c are
int a, b, c,
a = 40;
b = a++ ;
c = ++a ;
Now the values of a, b, c are
Answer: Option
Explanation:
The steps are : a is given the value 40, b is given the value of a before it is incremented (i.e., 40) and a is incremented to 41, a is incremented to 42 and c is given this value. Thus the result is 42, 40, 42.
Discussion:
1 comments Page 1 of 1.
Mahadev said:
6 years ago
I don't understand pre-increment and post-increment. Please anyone explain it.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers