Computer Science, asked by createcraftmani, 3 months ago

When a=6, c= ++a what will be the value of c in C++ language.

Answers

Answered by Oreki
2

After Execution:

   c = 7

Explanation:

   Initially, a = 6,

   So, c = ++a, c = 6 + 1 or c = 7.

Answered by bandameedipravalika0
1

Answer:

Explanation:

The value of c will be 7 .

What does  ++a means?

The expression a++ evaluates to the current value of a and increases a by one as a side effect. The expression ++a evaluates to the current value of a + 1 and increments a by one as a side effect.

Here the value of a is 6 . c is another variable and here it will store the increament value of a . As the ++ signs is before a , the increament will be first and then the vallue will be assigned. And ++a means a+1. So the value is 7 .

The value of c is 7  in C++ language.

#SPJ2

Similar questions