Module: INTEGER DIVISION AND REMAIN


Problem

1 /16


Integer Devision and Remainer

Theory Click to read/hide

In the module "Arithmetic Expressions" we talked about the features of the division operation in C ++.
Recall that for integer data (type int), you can use two division operations.
/ - integer division, when the fractional part is discarded as a result of the division operation
% - calculation of the remainder of the division

ЗАПОМНИМ!

n C and C ++, the result of dividing an integer by an integer is always an integer, the remainder when dividing is discarded.

Пример:
int a, b;
a = 10;
b = 3;
int c = a / b;   // Answer: с = 3
int d = a% b;    // Answer: d = 1
These operations are very important in programming. They need to be understood and used correctly. And this requires practice!

 

Problem

Write a program that, given the two numbers a and b, outputs the result of integer division and the remainder in the given format (see examples)

Input:  a and b
Output
in first line - the result of integer division a and b
in second line - remainder of the division a on b
Format is given in example

Пример входных и выходных данных
Входные данные
15 6
Выходные данные
15/6=2
15%6=3