Program to find multiple of 5?

Hello! I'm very new c++ and I'm trying to create a program that will tell you whether the given input is a multiple of 5. From what I understand and have tried doing % mod operator seems to be what will work best.
I haven't had any luck with what I've been doing though, so if I anyone could give me help I'd be grateful. Hopefully it's easier than it seems because I've been working on it for hours!
1
2
3
4
if (number_variable % 5 ==0)
{
        std::cout << "Number is a multiple of five./n";
}
I ended up coming up with this! Thank you!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <iostream>
using namespace std;

int main () 
{
int input;
int temp;
bool active = true;

     while (active) 
{
     std::cout << "Please enter a number!" << std::endl;
     std::cin >> input;

     std::cout << input << std::endl;


               if (input > 5|| input < 0)
     std::cout << "This is not a multiple of 5!" << std::endl;
               else {
     for (temp = input; temp <= 5; temp++) {
               if ((temp%5)==0)
     std::cout << temp << std::endl;
               }
     }
}
return 0;

}
Topic archived. No new replies allowed.