
#include<stdio.h>;
#include<stdlib.h>;
int main()
{
int n,x,y;
scanf("%d%d%d",&n,&x,&y);
int ctr=1;
while(ctr<n)
{
if(x%ctr==0 | | y%ctr==0)
{
if(x%y==0 || y%x==0)
{
printf("%d",ctr);
}
}
ctr++;
}
printf("%d",n);
}
Recommended searches
Top trending
Remove Characters from Left: The program must accept two string values S1 and S2 as the input. The…
Print Largest Even Number – Digits: Given a number N as the input, print…
#include<stdio.h>;
#include<stdlib.h>;
int main()
{
int n,x,y;
scanf("%d%d%d",&n,&x,&y);
int ctr=1;
while(ctr<n)
{
if(x%ctr==0 | | y%ctr==0)
{
if(x%y==0 || y%x==0)
{
printf("%d",ctr);
}
}
ctr++;
}
printf("%d",n);
}
Share with
/
Leave a Reply