J. Multiples Using C

๐Ÿ” Problem Solving from Codeforces using C language

This is a problem-solving post from Codeforces. Below is the problem with a short explanation and its solution.

This example is solved using C language.

๐Ÿงฉ Main Problem: Given two numbersย Aย andย B. Print “Multiples” ifย Aย isย multipleย ofย Bย orย vice versa. Otherwise print “No Multiples”.

๐Ÿ”— Problem Link: Codeforces Problem

๐Ÿ’ก Solution:

#include<stdio.h>
int main()
{
    int a, b;
    scanf("%d %d", &a, &b);
    if (a%b==0 || b%a==0) printf("Multiples");
    else printf("No Multiples");
    return 0;
}

โœ… This solution reads four integers from user and calculate using the given equation.

๐Ÿ“ Input:

9 3

๐Ÿ“„ Output:

Multiples

๐Ÿ“ Input:

12 5

๐Ÿ“„ Output:

No Multiples

๐Ÿ”— Find Similar Problems from Codeforcesโ€“ Click Here

๐Ÿค” More Problem Solving โ€“ Click Here

๐Ÿ“˜ Learn C Programming โ€“ Click Here

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top