Tuesday, 25 February 2014

Tagged Under: ,

Program to calculate sum and average of three numbers

Share















Source Code

#include<iostream>
#include<conio.h>
using namespace std;

int main()
{
 //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<<"\nSUM="<<sum;
cout<<"\nAverage="<<av;


getch(); //to stop the screen
}

Output


0 comments:

Post a Comment

Contact Us

Want to ask anything? Be our guest, give us a message.

Name Email * Message *