09 by ALDRIN

VIEWS: 64 PAGES: 1

									#include<iostream.h> #include<conio.h> void main() {clrscr(); int a,b; cout<<"scrie numarul a"<<endl; cin>>a; cout<<endl; cout<<"scrie numarul b"<<endl; cin>>b; cout<<endl; int max; max=0; if(a>b) max=a; else max=b; for(int i=max;i>1;i--) if(a%i==0 && b%i==0){a=a/i; b=b/i;} cout<<a<<"/"<<b<<endl; getch();}


								
To top