what is the value of b
if a=5;
b=++a + ++a
Answer Posted / anup dixit
13 is the correct answers. I'm attaching here a small java
program which proves this:
The program is:
------------------------------------------------------------
public class TestAddition
{
public static void main(String[] args)
{
int a=5;
System.out.println("1..Before a was : "+a);
int b = ++a + ++a;
System.out.println("Final a was : "+a+ ", int b =
++a + ++a is: "+b);
a=5;
System.out.println("2..Before a was : "+a);
int c= ++a+(++a);
System.out.println("Final a was : "+a+", int c=
++a+(++a) is: "+c);
}
}
------------------------------------------------------------
The output is:
------------------------------------------------------------
1..Before a was : 5
Final a was : 7, int b = ++a + ++a is: 13
2..Before a was : 5
Final a was : 7, int c= ++a+(++a) is: 13
Is This Answer Correct ? | 15 Yes | 10 No |
Post New Answer View All Answers
Do you know null pointer?
What are the scope of static variables?
What is variables in c?
What is the explanation for prototype function in c?
What is queue in c?
please can any one suggest me best useful video tutorials on c i am science graduate.please help me.u can email me to sas29@in.com
A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor
C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions
What is return in c programming?
Explain can the sizeof operator be used to tell the size of an array passed to a function?
What are header files why are they important?
What is the difference between malloc() and calloc() function in c language?
What is modeling?
application attempts to perform an operation?
Define recursion in c.