answersLogoWhite

0


Best Answer
Code Example:/* ******************************************************************************** * MODULE: main.c ******************************************************************************** * AUTHORS: * Flaun * * DESCRIPTION: * Prompts the user for 5 numbers and prints the sum of those numbers. ******************************************************************************** */ #include #define iNUMS_TO_SUM 5 int main(void) { int iInput = 0; int iSum = 0; int iCounter = 0; while(iCounter < iNUMS_TO_SUM) { printf("Enter a number: "); if(scanf("%d", &iInput) == 1) { iSum += iInput; } else { fprintf(stderr, "Error: Failed to read number from stdin.\n"); return 0; } iCounter++; } printf("Sum of numbers entered: %d.\n", iSum); return 0; }
User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Using loop input 5 numbers and output its total sum?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Write a program to aceept 5 numbers from keyboard n print itz total?

Sure! Here's a simple Python program that allows the user to input 5 numbers and then calculates and prints their total: numbers = [] for i in range(5): num = int(input(&quot;Enter a number: &quot;)) numbers.append(num) total = sum(numbers) print(&quot;The total is:&quot;, total) This program prompts the user to enter a number 5 times, converts each input to an integer, stores them in a list, calculates the sum of the numbers using the sum() function, and finally prints the total.


How many different sets of input conditions will produce a high out-put from a five-input OR gate?

Since the total number of possible input combinations is 25, which is 32, and since a low on all five inputs is the only condition resulting in a low at the output, the answer is 31.


What is the ratio of the energy a machine delivers to the energy supplied to it?

efficiencyThe ratio of useful energy to total input energy is called efficiency. It refers to the percentage of the work input that is converted to work output.


What is voltage offset?

Input offset voltage is the equivalent voltage at the input of an operational amplifier. If an amplifier has a voltage gain of ten and an input offset voltage of 10 microvolts, a level of 100 microvolts will appear at the output with no input. Manufacturers try to design an op amp so the input offset voltage is as small as possible to minimize this error voltage at the output of the amplifier, especially for applications where small voltages are being amplified.


Write the program in qbasic and add two numbers?

Cls input "enter two no.s ",a,b sum=a+b print "sum = ";sum end

Related questions

Total energy input equals equals the useful energy output plus?

Efficiency = ( useful energy output / total energy input ) x 100


What is marginal output?

The change in total output, when one more input is added/deducted. If Total Product of current period 'n', then the Marginal Product [Marginal Output]= Tn - Tn-1. It is the marginal change in the total output when one unit of input say labour or capital is added.


What is afficiecy?

Efficiency of a system in general is total output divided by total input to the system.


What the definition of efficiency?

The ratio of the effective output to the total input in any system.


How do you measure productivity?

Partial measures output/(single input)Multi-factor measures output/(multiple inputs)Total measure output/ (total inputs)Productivity =(Outputs/inputs)


A comparsion of energy output with energy input?

The result (ratio) of such a comparison is called the efficiency. Note that total energy output must be equal to energy input (conservation of energy); however, what is relevant for this comparison is the useful energy output.


What is released as one form of energy changes to another form?

Energy. Given that energy can be neither created nor destroyed, the total energy output equals that input, and in a system the ratio of that output energy desired to the total input gives the efficiency.


The ratio of useful work output to total work input is mechanical advantage?

ANSWER: no, it is called the efficiency.


What if urine output exceeds input?

If urine output exceeds input you will lose total body water. If you are retaining fluid, i.e. have too much, this is normal and good. At some point, if it does not stop , it will lead to dehydration.


Write a program to aceept 5 numbers from keyboard n print itz total?

Sure! Here's a simple Python program that allows the user to input 5 numbers and then calculates and prints their total: numbers = [] for i in range(5): num = int(input(&quot;Enter a number: &quot;)) numbers.append(num) total = sum(numbers) print(&quot;The total is:&quot;, total) This program prompts the user to enter a number 5 times, converts each input to an integer, stores them in a list, calculates the sum of the numbers using the sum() function, and finally prints the total.


What is the program to find sum of n natural numbers in c plus plus?

Initialise an unsigned integer to zero. As each number is input, increment the running total accordingly. When all numbers are input, display the total.


Definition of total product?

Total product refers to the overall quantity of output produced by all units of a factor of production (such as labor or capital) over a specific period of time. It measures the total output generated by a given level of input.