You are on page 1of 1

Write a program that takes two integers as input as input and tells whether first one is a factor of the

second.

#include<stdio.h>

int is_Multiple(int n1, int n2)


{
return n1 % n2 == 0;
}
int main()
{
int n1, n2;

printf( "Input the first integer : " );


scanf("%d", &n1);
printf( "Input the second integer: " );
scanf("%d", &n2);

if(is_Multiple(n1, n2))
printf( "\n%d is a multiple of %d.\n", n1, n2 );
else
printf( "\n%d is not a multiple of %d.\n", n1, n2 );

return 0;
}

Write a program that takes a number as input and display “YES” if the
input number is a multiple of 3, and has 5 in unit’s e.g 15, 75.

You might also like