Suppose that the input is 20 -16 -5 15 6 0. What is the output of the following code? (2, 3) int num; int temp = 0; cin >> num; while (num != 0) { if (num % 2 == 0) temp = temp + num; else temp...




Suppose that the input is 20 -16 -5 15 6 0. What is the output of the following code? (2, 3)


int num; int temp = 0;


cin >> num;


while (num != 0)


{



if (num % 2 == 0)



temp = temp + num;



else



temp = temp - num;



cin >> num;


}



cout




correct the following code so that it reads and finds the sum of 20 numbers. (2, 3)



int count = 0;


int sum = 0;


while (count


{



sum = sum + count;



count++;



cin >> num;


}





"temp="">




correct the following code so that it reads and finds the sum of 20 numbers. (2, 3)



int count = 0;


int sum = 0;


while (count


{



sum = sum + count;



count++;



cin >> num;


}




>




May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here