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:

What does the command prompt uses?
In object-oriented programming (OOP), which of the following concepts allows different classes to be treated as instances of the same superclass?
HTML stands for :
A markup language used for creating web pages and web applications
Find the user defined data type in C :