Write a program to check the divisibility of number a by another number say b
please tell me the correct answer
I will mark as brainlist
who tell me right
Share
Write a program to check the divisibility of number a by another number say b
please tell me the correct answer
I will mark as brainlist
who tell me right
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Explanation:
Given an integer N where
1 \leq n \leq 10^{18}. The task is to check whether the number is not divisible by any of its digit. If the given number N is divisible by any of its digits then print “YES” else print “NO”.
Examples:
Input : N = 5115
Output : YES
Explanation: 5115 is divisible by both 1 and 5.
So print YES.
Input : 27
Output : NO
Explanation: 27 is not divisible by 2 or
Answer:
include <stdio.h>
void main()
{
int a, b;
printf("enter values of a and b");
scanf("%d %d, &a &b");
if(a%b==0)
{
printf("it is divisible");
}
else
{
printf("it is not divisible");
}
}
Explanation:
a%b returns the remainder when a is divided by b.
so if(a%b==0) it means a is divisible by b