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:

Choose the correct HTML element for the largest heading.
An example for an empty tag in HTML is :
How do you define a function in JavaScript ?
Which of the following is a programming Language ?
Which of the following Object Oriented Programming concept provides usability ?