int gcd(int a,int b){ int temp; if(b>a) { temp=a; a=b; b=temp; } while((temp=a%b)!=0) { if(temp>b) { a=temp; }else { a=b; b=temp; } } return temp;}