Course Solutions Uncategorized (Solved) : C Code Program Calculate Sum 10 Positive Integers Include Int Main Variable Definition Int Q33026312 . . . .

(Solved) : C Code Program Calculate Sum 10 Positive Integers Include Int Main Variable Definition Int Q33026312 . . . .

 

// C code// This program will calculate the sum of 10 positiveintegers.
#include <stdio.h>Int main (){/* variable definition : */int count, value, sum;Double avg;/* initialize*/Count = 0;Sum = 0;Avg = 0.0;//Loop through to input valuesWhile (count < 10){Printf(“Enter a positive integern”);Scanf (“%d”, &value);If (value >= 0) {Sum = sum + value;Count = count + 1;}Else {Printf (“value must be positive n”);}
}// calculate avg. need to type cast since two integers willyield an integerAvg = (double) sum/count;Printf(“average is %1fn “ , avg);Return 0;{

2. Change the c code to average 20 intergers.
3.Prepare a new test table with at least 3 distinct test caseslisting

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post