Solution of URI 1044::Multiples
Before seeing the solution make sure that you have tried enough. Don’t copy the whole code, just find out the logic. If you feel any problem, you will inform me by comment.
#include<stdio.h>
int main()
{
int a,b;
scanf("%d%d",&a,&b);
if (a>b) {
if (a%b==0) {
printf("Sao Multiplos\n");
}
else {
printf("Nao sao Multiplos\n");
}
}
else if (b>a){
if (b%a==0) {
printf("Sao Multiplos\n");
}
else {
printf("Nao sao Multiplos\n");
}
}
return 0;
}
No comments