Write a function multiple 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.
I dont know what I need to do to fix this!
Code:#include <stdio.h> int multiple(int x, int y, int a); int main() { int x; int y; int m; int a; printf("Enter first integer here:"); scanf("%d", &x); printf("Enter second integer here:"); scanf("%d", &y); m = multiple(x,y,a); printf("%d is a multiple of the %d\n", m, m); return 0; } int multiple(int x, int y, int a) { a = x % y; if(a == 0){ printf("%d is a multiple of the %d\n", y, x); return 1; else(a != 0); printf("%d is not a multiple of the %d\n", y, x); return 0; } }



LinkBack URL
About LinkBacks



