Write a program whose input is two integers, and whose output is the first integer and subsequent increments of 5 as long as the value is less than or equal to the second integer C++

Respuesta :

tonb

Answer:

#include <iostream>

using namespace std;

int main() {  

 int start, end;

 cout << "Enter start number: ";

 cin >> start;

 cout << "Enter end number: ";

 cin >> end;

 for(int n=start; n<=end; n+=5) {

   cout << n << " ";

 }

}

Explanation:

I output the numbers space separated.