Q:

Write a C program that reads two integers and checks whether they are multiplied or not

0

Write a C program that reads two integers and checks whether they are multiplied or not

Test Data :
Input the first number: 5
Input the second number: 15
Expected Output:
Multiplied!

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include <stdio.h>
int main() {
	int  x, y;
    printf("\nInput the first number: "); 
    scanf("%d", &x);
    printf("\nInput the second number: ");
    scanf("%d", &y);
    if(x > y) 
	{
		int temp;
		temp = x;
		x = y;
		y = temp;
	}
	if((y % x)== 0) 
	{
		printf("\nMultiplied!\n");
	} 
	else 
	{
		printf("\nNot Multiplied!\n");
	}	
	return 0;
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now