NBA - Boston Celtics

Wednesday, 25 January 2012

SUM AND AVERAGE IN C++


#include<iostream.h>
main()
{
float a, b, sum, average;
 cout << "enter the value of a:";
 cin >> a;
 cout << "enter the value of b:";
 cin >>b;
 sum=a+b;
 average=sum/2;
 cout<<"sum:"<<sum<<"\n";
 cout<<"average:"<<average<<"\n";
}

No comments:

Post a Comment