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 Document Right 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<10;a++) { printf("\n\nEnter value number %d > ",a+1); scanf("%d", &list[a]); total = total + list[a]; } printf("\n n %% of total"); printf("\n__________________________"); //loop to print outputs for user for(a=0;a<10;a++) { printf("\n\n %5d %6.2lf",list[a],((double) list[a]/(double) total)*100.0); } return (0); }...
View Full Document

{[ snackBarMessage ]}

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