C Program to calculate sum and average of three numbers
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr() //to clear the screen
float a,b,c,sum,av;
cout<<"Enter three numbers:";
cin>>a>>b>>c;
sum=a+b+c;
av=sum/3;
cout<<"
SUM="<<sum;
cout<<"
Average="<<av;
getch(); //to stop the screen
}
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.