Uva 11388 – GCD LCM

Solution :-

#include<stdio.h>
int main()
{
int n,m,t;
scanf(“%d”,&t);
while(t–)
{
    scanf(“%d%d”,&m,&n);
    if(n%m==0)
    printf(“%d %dn”,m,n);
    else
    printf(“-1n”);
}
return 0;
}

At First you can try to solve this problem if you can’t than see this code & find what’s your problem . If you copy paste this code you could not improve yourself in programming .

Posted by Shipu Ahamed

Leave a Reply