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 SQL refer to ?
Pick out OOP language from the following :
How do you define a function in JavaScript ?
Select the JavaScript object model that represents an HTML document as a tree structure and supports dynamic updates
ഒരു പ്രോഗ്രാം താഴെപ്പറയുന്ന നിർദ്ദേശങ്ങൾ നടപ്പിലാക്കുന്നു. INPUT N IF N > 0 GOTO L1 PRINT "NEGATIVE" STOP L1: IF N < 100 GOTO L2 PRINT "LARGE" STOP L2: PRINT "SMALL POSITIVE" STOP N-ന്റെ ഇൻപുട്ട് മൂല്യം 120 ആണെങ്കിൽ, താഴെപ്പറയുന്നവയിൽ ഏത് പ്രസ്താവനയാണ് ശരി ?