answersLogoWhite

0


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 */ }

User Avatar

Wiki User

βˆ™ 2009-09-28 16:56:05
This answer is:
User Avatar
Study guides

Data Science

➑️
See all cards
4.44
β˜†β˜…β˜†β˜…β˜†β˜…β˜†β˜…β˜†β˜…
9 Reviews

Add your answer:

Earn +20 pts
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?
magnify glass
imp
Related questions

How do you know whether a number is a multiple of another number?

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


How do you write a program to accept a month number and display a maximum number of days?

with a computer.


How can you tell whether a given number is a multiple of 2?

If it is even


Write a c program using while loop to accept a number check and display message whether number is perfect or not?

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


Write a program to enter a number and check whether number is divisible by 7 or not?

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


Tell whether the seond number is a multiple of the first 271?

yes


How do you write a program to accept a number and print it's digit in words?

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


C program to check whether a given number is binary or not?

1010101


Write a program to check whether the number is divisible by 3 or not by using the?

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 program By using if else statement to read a number and check whether it is positive or negative?

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


Write a program to accept a number and check wheather it is divisible by 5 or not?

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


Write a c program to accept a numbers and generate square root cube and exponential values?

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

People also asked