203k views
0 votes
Write a program that repeatedly asks the user to type in an integer until they input a multiple of 7

User Mudar
by
4.4k points

1 Answer

3 votes

Answer:

See the code in the explanation below

Step-by-step explanation:

For this excersie we are going to be using C++, if you want me to produce the code in another language do let me know

// Online C++ compiler to run C++ program online

#include <iostream>

using namespace std;

int main()

{

int Number;

do

{

cout <<"Enter a multiple of seven: ";

cin >> Number;

if(Number%7 == 0 ){

cout<<"correct!!! the number is a multiple of seven";

}

} while(Number%7 != 0);

}

User ChristopherS
by
4.6k points