0

Help me complete with this output :x

what is the code when the ouput is like this : _______________________________ enter your first number = //ex: 2 enter your last number = // ex: 6 the answer is : 2 + 3 + 4 + 5 + 6 = 20 -------------------------------- i can make output 2-6, but can't make the calculation. Any suggestion ?

12/4/2017 11:49:18 AM

muwa00.dat

2 Answers

New Answer

+5

int start, end, sum = 0; cin>>start>>end; for(int i=start;i<=end;i++) { cout<<i<<"+"; sum+=i; } cout<<"="<<sum<<endl; // Add other required cout operations yourself.

+2

thx bro.