positive integer

assist in writing a program that inputs in positive integer and outputs its proper divisions

Comments

  • program divide1;

    procedure Main();
    var
    num : integer;
    ans : integer;
    i : integer;
    begin
    Write('Enter number:');
    ReadLn(num);
    for i:=1 to num do
    begin
    ans:= num Mod i;
    if ans=0 then
    begin
    Write(i,' ');
    end;
    end;

    end;

    begin
    Main();
    end.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion