User Profile
Collapse
-
ok this is exactly what my text says,...Write a C++ program with a loop structure that reads in 2 intergers, calculates the sum of all the intergers between thee 2 intergers (not including these 2 intergers) if any, and displays the final result. For example, if the 2 intergers ou read are -2 and 5, then your program should output 9 (=-1+0+1+2+3+4).
Sakinah :-)Leave a comment:
-
-
Looping Sums
Hi I am very very new to C++ i am trying to create a loop that reads 2 integers and addsall the intergers between. I am very very lost!
#include <iostream>
using namespace std;
int main()
{
int num1=10;
int num2=0;
int total;
while (num2<10)
{ total= num2+ 1;
total++;
}
system ("pause");
return 0;...
No activity results to display
Show More
Leave a comment: