#include int multiple(int a, int b) { //a pair of integers whether the second in
ID: 3653934 • Letter: #
Question
#include int multiple(int a, int b) { //a pair of integers whether the second integer is a multiple of the first. if(b%a==0) return 1; else return 0; } int main() { int a; int b; printf("Type the first Number: "); scanf("%d",&a); printf("Type the second Number: "); scanf("%d",&b); if(multiple(a,b)) printf("%d is a multiple of %d", &a,&b); else printf("%d is not a multiple of %d", &a,&b); return 0; } Why when I input a and b does it output a random number? EXAMPLE OUTPUT: Type the first Number: 8 Type the second Number: 9 1358519208 is not a multiple of 1358519204Explanation / Answer
#include int multiple(int a, int b) { //a pair of integers whether the second integer is a multiple of the first. if(b%a==0) return 1; else return 0; } int main() { int a; int b; printf("Type the first Number: "); scanf("%d",&a); printf("Type the second Number: "); scanf("%d",&b); if(multiple(a,b)) printf("%d is a multiple of %d", a,b); else printf("%d is not a multiple of %d", a,b); return 0; }Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.