Homework6-2 - //loop to store users numbers...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Homework #6 /* * Program: HW6_2 * Written by Justin Waters * Inputs: User enters 10 values * Outputs: 10 entered values and percentages for each * Description:User enters 10 numbers,program tells user each number and its % of the total of all numbers entered. * */ #include <stdio.h> #include <math.h> int main (void) { int list[10], total=0; int a; printf("\nWelcome to my %% calculator program");
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: //loop to store users numbers for(a=0;a&lt;10;a++) { printf(&quot;\n\nEnter value number %d &gt; &quot;,a+1); scanf(&quot;%d&quot;, &amp;list[a]); total = total + list[a]; } printf(&quot;\n n %% of total&quot;); printf(&quot;\n__________________________&quot;); //loop to print outputs for user for(a=0;a&lt;10;a++) { printf(&quot;\n\n %5d %6.2lf&quot;,list[a],((double) list[a]/(double) total)*100.0); } return (0); }...
View Full Document

Page1 / 2

Homework6-2 - //loop to store users numbers...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online