Challenger App

No.1 PSC Learning App

1M+ Downloads

What is the value of sum after the execution of the following code?

int sum = 0;

for (int i = -5; i<=;i++)

{

         if (!i) break;

         sum += i;

}

 

 

A0

B-5

C-15

D15

Answer:

C. -15

Read Explanation:

sum = -15


Related Questions:

Which access specifier is used for constructors in C++?
The 'C' Programming language was designed by ____ as a system programming language for UNIX.
ASCII is a
With the help of assembler the source programme converts into :
Find the user defined data type in C :