In: Computer Science
Write a function, named isMultipleOfFive that accepts integer argument. When the function is called, it should display if the argument "is a multiple of 5" or "is not a multiple of 5".
Source Code:
Output:
Code in text format (See above images of code for indentation):
#include <iostream>
using namespace std;
/*main function*/
int main()
{
/*function prototype*/
void isMultipleOfFive(int);
int n;
/*read a integer from user*/
cout<<"Enter a number: ";
cin>>n;
/*function call*/
isMultipleOfFive(n);
return 0;
}
/*function definition*/
void isMultipleOfFive(int n)
{
/*check if multiple of 5 or not*/
if(n%5==0)
cout<<n<<" is a
multiple of 5";
else
cout<<n<<" is not a
multiple of 5";
}