instructions
read in 4 numbers. sum up the 4 numbers. print the four numbers and the sum
Using the Marie editor and compiler, write a program that will satisfy these requirements. Cut and paste your code (from the editor) into the answer area of this question
C+
#include<iostream>
using namespace std;
int main(){
int n1,n2,n3,n4;
//reading 4 numbers from user
cin>>n1>>n2>>n3>>n4;
//printing variables and sum
cout<<n1<<" + "<<n2<<" + "<<n3<<" + "<<n4<<" = "<<n1+n2+n3+n4<<endl;
}
NOTE : PLEASE COMMENT BELOW IF YOU HAVE CONCERNS.
Please Like and Support me as it helps me a lot
Get Answers For Free
Most questions answered within 1 hours.