Skip to content

Instantly share code, notes, and snippets.

@Manume
Last active August 29, 2015 14:01
Show Gist options
  • Save Manume/38a5dc0531482eac1c3f to your computer and use it in GitHub Desktop.
Save Manume/38a5dc0531482eac1c3f to your computer and use it in GitHub Desktop.
sum and average of two numbers
#include <iostream.h>
#include <iostream.h>
#include <conio.h>
void main()
{
clrscr();
int x,y,sum;
float average;
cout << "Enter 2 integers : " << endl;
cin>>x>>y;
sum=x+y;
average=sum/2;
cout << "The sum of " << x << " and " << y << " is " << sum << "." << endl;
cout << "The average of " << x << " and " << y << " is " << average << "." << endl;
getch();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment