C

Multipls Of x And y

88
0

The program must accept two integers X and Y as the input. The program must print the first 10 multiples of X if X is greater than Y. Else the program must print the multiples of Y as the output.

Boundary Condition(s):

1 <= X, Y <= 100

Input Format:
The first line contains the value of X and Y separated by a space.

Output Format:

The first line contains the first 10 multiples of either X or Y separated by a space.

Example Input/Output 1:

Input
45 34
Output
45 90 135 180 225 270 315 360 405 450
Explanation:
Here 45 is greater than 34. Hence the first 10 multiples of 45 are printed as the output

Example Input/Output 2

Input
64
Output
6 12 18 24 30 36 42 48 54 60

#include<stdio.h>
#include<stdlib.h>
int main()
{
	int x,y; 
	scanf("%d %d", &x, &y);
	if(x>y)
	{
		for (int i=1;i<=10;i++)
			printf("%d ",x*i);
	}
	else
	{
		for (int i=1;i<=10;i++) 
			printf("%d ",y*i);
	}
}
Hephzibai
WRITTEN BY

Hephzibai

Hephzibai is a driven third-year student at St. Joseph's Institute of Technology, specializing in Computer Science and Engineering. With a keen interest in data science and also in fullstack.
One of my greatest strengths lies in my programming skills, which I've honed through countless hours of practice and participation in coding challenges. Platforms like Skillrack, HackerRank, and others have been my playgrounds, where I've tackled a wide range of problems with creativity and determination.

Leave a Reply

Your email address will not be published. Required fields are marked *