URI ONLINE JUDGE SOLUTION 1044 - Multiples

Problem


Read two nteger values (A and B). After, the program should print the message "Sao Multiplos" (are multiples) or "Nao sao Multiplos" (aren’t multiples), corresponding to the read values.

Input

The input has two integer numbers.

Output


Print the relative message to the input as stated above.

sample input output

Solution
C programming source code for uri online judge beginner problem 1044-Multiples:

#include<stdio.h>
int main()
{
    int a,b;
    scanf("%d%d",&a,&b);
    if(a%b==0 || b%a==0)
        printf("Sao Multiplos\n");
    else
        printf("Nao sao Multiplos\n");
    return 0;

}

How it works? This is the beginner level  problem of uri online judge.Here you would have to check if one the number is dividable by other one.If it is then you should print the first message if not then you should print the second message.Hopefully you would understand the problem.Don't copy paste the code as same.Just try to understand it and then try yourself. It would be better for you.

Comments

Popular posts from this blog

URI ONLINE JUDGE SOLUTION 1021 - Banknotes and Coins

URI ONLINE JUDGE SOLUTION 1040 - Average 3

URI ONLINE JUDGE SOLUTION 1036 - Bhaskara's Formula