Sum Avg - printf("The sum is...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/* This program finds the sum + avg of 3 numbers */ #include<stdio.h> void main() { int a,b,c,sum; float avg; printf("Please enter 3 numbers "); scanf("%d%d%d",&a,&b,&c); sum = a + b + c; avg=sum/(float)3; printf("The three numbers are %d %d %d\n",a,b,c);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: printf(&quot;The sum is %d\n&quot;,sum); printf(&quot;The average is %f\n&quot;,avg); } /* Please enter 3 numbers 52 46 98 The three numbers are 52 46 98 The sum is 196 The average is 65.333336 Press any key to continue . . . */...
View Full Document

Ask a homework question - tutors are online