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 of these types of values result from a delete operator?
US ലെ ബെൽ ലബോറട്ടറിയിൽ ഡെന്നിസ് റിച്ചി , കെൻ തോംപ്സൺ എന്നിവർ ചേർന്ന് തയാറാക്കിയ ഓപ്പറേറ്റിംഗ് സിസ്റ്റം ഏതാണ് ?
Which of the following data structure is linear type?
The method of making a programme error free :
A terminal node in a binary tree is called :