Live quiz

C Programming - Part 30

Question 1 of 25 Hints left: 3
Q1

Consider the following program fragment: for(c=1, sum=0; c <= 10; c++) { scanf("%d", &x); if( x < 0 ) continue; sum += x; } What would be the value of sum for the input 1, -1, 2, -2, 3, -3, 4, -4, 5, -5

  • A
  • B
  • C
  • D