-->

Facebook

Jasper Roberts - Blog

Thursday, March 12, 2015

Write a C++ Program to calculate average and sum.

#include<iostream.h>
//using namespace std;
void main()
{
float x,y,s,a;
cout<<"Enter the number : "<<"\n";
cin>>x>>y;
s=x+y;
a=s/2;
cout<<"\nSum = "<<s;
cout<<"\nAvg = "<<a;
}

No comments:

Post a Comment