what is the value of b
if a=5;
b=++a + ++a

Answer Posted / sagar

here in b=++a + ++a;
a
Initial Value 5
First Prefix 6
Second Prefix 7
Final Equation b = 7 + 7 = 14...
So,correct answer is 14....

if the equation was as below:
c=++a;//a==6
d=++a;//a=7
b=c+d;//b=6+7=13
then b==13...

Is This Answer Correct ?    96 Yes 29 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When should a far pointer be used?

591


What is switch in c?

637


why wipro wase

1821


How can a program be made to print the line number where an error occurs?

639


Can we use any name in place of argv and argc as command line arguments?

602






What does *p++ do?

576


What is a nested loop?

641


to print the salary of an employee according to follwing calculation: Allowances:HRA-20% of BASIC,DA-45% of BASIC,TA-10%. Deductions:EPF-8% of BASIC,LIC-Rs.200/-Prof.Tax:Rs.200/- create c language program?

1563


Why array is used in c?

547


What does sizeof int return?

582


Why we use void main in c?

584


Describe newline escape sequence with a sample program?

641


What is class and object in c?

579


Do you know pointer in c?

575


Badboy is defined who has ALL the following properties: Does not have a girlfriend and is not married. He is not more than 23 years old. The middle name should be "Singh" The last name should have more than 4 characters. The character 'a' should appear in the last name at least two times. The name of one of his brothers should be "Ram" Write a method: boolean isBadBoy(boolean hasGirlFriend , boolean isMarried, int age , String middleName , String lastName , String[] brotherName); isHaveGirlFriend is true if the person has a girlfriend isMarried is true if the person is married age is the age of the person middleName is the middle name of the person lastName is the last name of the person brotherName is the array of the names of his brothers

1418