# You are given two integers, say M and N.

closed Jan 15
You are given two integers, say M and N.

You must check whether M is an exact multiple of N, without using
loops.
You have to output 0 if M is not a multiple of N.
You have to output M/N if M is a multiple of N.

answered Jul 31, 2019 by anonymous
#include<stdio.h>

int m,n;

{

printf("enter the value of m");

scanf("%d",&m);

printf("enter the value of n");

scanf("%d",&n);

if(m%n==0)

{

printf("enter the value of m");

else

printf("enter the value of n");

}

return 0;

}
+1 vote
answered Jul 31, 2019 by Venkata Ashik Kalangi
#include<stdio.h>
int main()
{
int M,N;
scanf("%d %d",&M,&N);

if(M%N==0)
printf("%d",M/N);
else
printf("0");

return 0;
}
answered Jul 31, 2019 by anonymous
Try checking out the modulus operator.
+1 vote
answered Jul 31, 2019 by (170 points)
#include <stdio.h>

int main()
{
int m,n;
printf("enter m and n values:");
scanf("%d%d",&m,&n);
if(m%n==0)
{
printf("%d",m/n);
}
else
printf("%d",0);

return 0;
}
answered Jul 31, 2019 by (280 points)
int m,n;

if m%n==0:

print(m/n)

else:

print(0)
answered Jul 31, 2019 by (300 points)
#include<stdio.h>
int main()
{
int n,m;
scanf("%d%d",&m,&n);
if(m%n!=0)
printf("0");
else
printf("%d",m/n);
return 0;
}
answered Jan 14 by (140 points)

//Check whether M is an exact multiple of N, without using loops.

#include<stdio.h>
int main()
{
int M,N;
scanf("%d %d",&M,&N);

if(M%N==0)
printf("%d",(M/N)/2);
else
printf("0");

return 0;
}