Write a program of addition of two numbers and their average in C++

/*This is a program of addition of two numbers and their average in C++*/
#include<iostream>
#include<conio.h>
int main()
{
int num1,num2,sum;
float avg;

std::cout<<"\n Enter any 2 numbers: ";
std::cin>>num1>>num2;

sum=num1+num2;
avg=sum/2.0;

std::cout<<"\n Sum= "<<sum<<" Average= "<<avg;

getch();
return 0;
}

Previous
Next Post »