You are not logged in.
- Topics: Active | Unanswered
Pages:: 1
#1 2015-09-15 05:53:26
Sum Value:
http://interviewquestionsanswers.org/quiz/C-Programming http://interviewquestionsanswers.org/qu … Structures
Directions:
Consider the following program fragment:
for(c=1, sum=0; c <= 10; c++)
{
scanf("%d", &x);
if( x < 0 ) continue;
sum += x;
}
Question:
What would be the value of sum for the input 1, -1, 2, -2, 3, -3, 4, -4, 5, -5
Option A):
15
Option B):
12
Option C):
131
Option D):
14
Correct Answer is Option A):
15
Failure is the first step towards seccess.
Offline
2015-09-15 05:53:26
- Advertisement
- Ads By Google
Re: Sum Value:
Pages:: 1