Write an allgorithm that checks whether the number entered by the user is exactly divisible by 5 but not by 11
Answers
Answer:
Input a number from user. Store it in some variable say num . To check divisibility with 5, check if(num % 5 == 0) then num is divisible by 5. ... To check divisibility with 5 and 11 both, check if((num % 5 == 0) && (num % 11 == 0)) , then number is divisible by both 5 and 11.
Answer:
The idea of this program is to decide whether the natural number entered by the user is odd or even. For this program, you will use modulus operation. Where if you divide a number by 2 and the result is zero remainder then it is even else if it has a remainder it is odd.
Read more: Write an algorithm, flowchart and C program that checks whether the number entered by user is exactly divisible by 5 but not by 11? - Problem of Fundamental of Computer progarmming