14:53 Multiples | |
Write a function isMultiple that determines for a pair of integers whether the second integer is a multiple of the first. The function should take two integer arguments and return 1 (true) if the second is a multiple of the first, and 0 (false) otherwise. Use this function in a program that inputs a series of pairs of integers. Напишите функцию isMultiple для двух целых, которая передает, кратно ли второе число первому. Функция должна получать два целых аргумента и возвращать 1(true), если второе число кратно первому, и 0(false) в противном случае. Используйте эту функцию в программе, которая вводит серию пар целых чисел. #include <stdio.h> bool isMultiple(int, int); bool isMultiple(int i1, int i2) z = (i2 % i1); if( z == 0) | |
|
Всего комментариев: 0 | |