Best Answer

To write a program to check whether a particular number is a multiple of 5, or any other number for that matter, you check to see if the first number, modulus the second number, is zero.

if (N % 5 == 0) { /* N is divisible by 5 */ }

If you don't have the modulus (%) operator, you can use the explicit expression

if (N - int (N / 5) * 5 == 0) { /* N is divisible by 5 */ }

Study guides

☆

Q: How do you write a program in c plus plus to accept a number and check whether it is a multiple of 5?

Write your answer...

Submit

Still have questions?

Continue Learning about Engineering

I assume you mean is an if the number is an integer multiple of 3i am unfamiliar with C but the theory would be,find if a is integer multiple of 3b=a/3b==round(b).if 1 "yes"else "no"this is an inefficiency way but will get the job done

any integer is input through the keyboard. write a program to find out whether it is an odd number or even number using if else statement in c#.

Reference:cprogramming-bd.com/c_page2.aspx# palindrome

This program reverses an integer (entered by the user) using while loop. Then, if statement is used to check whether the reversed number is equal to the original number or not.

The trivial way would be to reverse the input string and compare it to the original. If they're identical, the number is palindromic.

Related questions

Divide the smaller number into the larger one. If the answer is an integer, it's a multiple.

with a computer.

If it is even

The program is here guys.......... //Finding whether the given number is perfect or not //Starts here #include<stdio.h> void main() { int i=1,temp=0,number; scanf("%d",&number); while(i<=number/2){ if(number%i==0) temp+=i; i++; } if(temp==number) printf("Its a perfect number"); else printf("Its not a perfect number"); } //ends here

wap to input a number and check whether it is divisible by 7 or no

yes

Write a program enters the ten-digit number and prints Using the largest for

1010101

I assume you mean is an if the number is an integer multiple of 3i am unfamiliar with C but the theory would be,find if a is integer multiple of 3b=a/3b==round(b).if 1 "yes"else "no"this is an inefficiency way but will get the job done

write a c++program by using if statement to read a number and check whether it is positive or negative

bool isNumberDivisibleByFive(int number) { return(!(number % 5)); }

write a c program to accept a number and generate a square root cube and exponential values

People also asked