Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  hi
Language: PASCAL
Code:
program sumup;
var i: integer;
    common_diviser,numerator, denominator: integer;
begin
    write('input numerator of a fraction: ');
    readln(numerator);
    writeln;
    write('input denominator of a fraction: ');
    readln(denominator);
    writeln;
    writeln('Your fraction is : ', numerator,'/', denominator);
    if numerator mod diviser = 0 then common_diviser:= denominator
    else common_diviser = 1     
    if common_diviser<>1 then writeln('Your simplified fraction is:'numerator/common_diviser,'/',denominator/common_diviser);
    else writeln('Your simplified fraction is :',numerator,'/',denominator);

readln
end.
Comments: