Hey! I need help. Im new to programming. So how the codings will like to be ?
write a program to accept an integer number from the user and display the message '" the number is divisible by both 3 and 5" or "the number is NOT divisible by both 3 and 5" according to the input value
Hi Epeeist, Welcome to C++! This code will handle your problem, but to understand what's going on study the tutorials, buy a book, or listen to a good instructor. As Vlad said, start off with something simple. Cheers, Don.
int main ()
cout <<"To check whether a number is divisible by both 3 and 5. \n\n";
cout <<"Please enter a number: ";
if (i%15 ==0 && i !=0 )
cout <<"\nThe number "<<i<<" is divisible by both 3 and 5.\n";
cout<<"\nThe number "<<i<<" is NOT divisible by both 3 and 5.\n";