/NPTEL-Introduction-to-Programming-in-C-Assignment-1-Question-2

NPTEL Introduction to Programming in C Assignment 1 Question 2

Primary LanguageCGNU General Public License v3.0GPL-3.0

NPTEL-Introduction-to-Programming-in-C-Assignment-1-Question-2

NPTEL Introduction to Programming in C Assignment 1 Question 2

Question 2

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.

Input

Two integers, say M and N.

Output

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.

Sample input 1

100 5

Sample output 1

20

Sample input 2

16 4

Sample output 2

4

Sample input 3

4 16

Sample output 3

0

Sample input 4

45 49

Sample output 4

0