Subscribe For Free Updates!

We'll not spam mate! We promise.

Sunday 26 August 2012

C++ code todisplaying add, sub, mul, div and average of three inputs



//Displaying addition, subtraction, multiplication, division and average of three inputs
//Programmer name: Sohail ahmed
//Date:20/02/2010

#include<iostream.h>
#include<conio.h>

int main()
{
clrscr();
int num1, num2, num3;
cout<<"Enter 1st integer: ";
cin>>num1;
cout<<"\nEnter 2nd integer: ";
cin>>num2;
cout<<"\nEnter 3rd integer: ";
cin>>num3;
clrscr();

//Output of addition

cout<<"\nAddition: ";
cout<<num1+num2+num3;

//Output of multiplication

cout<<"\nMultiplication: ";
cout<<num1*num2*num3;

//Output of Average

cout<<"\nAverage: ";
cout<<(float)num1+num2+num3/2;

getch();
return 0;
}

Socializer Widget By CodingLovers
SOCIALIZE IT →
FOLLOW US →
SHARE IT →

0 comments:

Post a Comment