48: Write a program to check if a number is a multiple of 5.
// Write a program to check if a number is a multiple of 5.
#include <iostream>
using namespace std;
int main()
{
int num;
cout << "Enter the number: ";
cin >> num;
if (num % 5 == 0)
{
cout << num << " is a multiple of 5";
}
else if (num % 5 != 0)
{
cout << num << " is not a multiple of 5";
}
return 0;
}
Comments
Post a Comment