?
/*************************************************************************
> File Name: ex1.13.cpp
> Author:
> Mail:
> Created Time: Thu 18 Jan 2024 10:16:19 AM CST
************************************************************************/
#include<iostream>
using namespace std;
int main(){
int start, end, sum;
//ex1.9
sum = 0;
start = 50;
end = 100;
for(int i = start; i <= end; i++){
sum += i;
}
cout<<"sum = "<<sum<<endl;
//ex1.10
start = 10;
end = 0;
for(int i = start - 1; i > end; i--){
cout<<i<<" ";
}
cout<<endl;
//ex1.11
cout<<"Enter start and end numbers: ";
cin>>start>>end;
if(start < end){
for(int i = start + 1; i < end; i++){
cout<<i<<" ";
}
cout<<endl;
}
else{
for(int i = start - 1; i > end; i--){
cout<<i<<" ";
}
cout<<endl;
}
return 0;
}