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