Adding 4 numbers

Create a program that will accept 4 numbers. Get sum1 (sum of 1st and 2nd number) and sum2 (sum of 3rd and 4th number). Display both of the sums and which one is bigger.

Please help me :) I dont know what to do?
Use cin to get input from user http://www.cplusplus.com/doc/tutorial/basic_io/
Use cout to display variables to the console.
You'll have something along this in your code
sum1 = n1 + n2;
sum2 = n3 + n4;

If you want people to help you, you have to try to help yourself first and post actual code you need help with.
Last edited on
hi i think this program will help

#include "iostream"
#include "conio.h"
using namespace std;
int main()
{
float num1,num2,num3,num4,sum1,sum2;
cout<<"Enter 4 numbers";
cin>>num1>>num2>>num3>>num4;
sum1=num1+num2;
sum2=num3+num4;
cout<<"Sum of num1 and num2="<<sum1;
cout<<"\nSum of num3 and num4="<<sum2;
if (sum1>sum2)
cout<<"\nSum1 is bigger";
else
cout<<"\nSum2 is bigger";
getch();
return 0;
}
Topic archived. No new replies allowed.