what is the value of b
if a=5;
b=++a + ++a
Answer Posted / naresh
Not a very tough question. Important thing to note that in
any expression pre increment operator has a higher prority
than arithemetic operator as a result value of a is
increment is first two times then value of b is evaluated.
So b = 7*7 = 14.
in first ++a we get a=6
in next ++a we get a=7
and b=7+7=14
This question will result in same output for most of the
compilers, but some rare compiler may produce an entire
diffrenent parse tree resulting in an undefined result
| Is This Answer Correct ? | 28 Yes | 13 No |
Post New Answer View All Answers
What is the explanation for the dangling pointer in c?
how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12
What are header files and what are its uses in C programming?
Can we declare function inside main?
write a program to print data of 5 five students with structures?
What does it mean when the linker says that _end is undefined?
Is flag a keyword in c?
a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above
Is it better to use a macro or a function?
What is an lvalue?
Explain enumerated types in c language?
Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop
Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.
What are the types of unary operators?
Explain how do you determine the length of a string value that was stored in a variable?