1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | C Este Programa Lˆ Um N£mero Qualquer Mostra DivisÆo Desse N£mero Por 3. Program Divisao Implicit None Real Quociente Integer Inteiro_Qualquer, Resto Print *, "Entre Com O Quociente Da DivisÆo" Read(*,*) Inteiro_Qualquer Do While(Inteiro_Qualquer.NE.0) Quociente = Inteiro_Qualquer/3 Resto = MOD(Inteiro_Qualquer,3) Print 100,Inteiro_Qualquer, Quociente, Resto 100 Format (3X, "Quociente Da DivisÆo = ", i5, " Por 3 =", f8.2, "E &O Resto Dessa DivisÆo ‚",i5) Resto = MOD(Inteiro_Qualquer,2) If(Resto == 0) Then Print *, " Par" Else Print *, " Ömpar" EndIf Read(*,*) Inteiro_Qualquer EndDo Print *, "Fim Programa" Stop End Program Divisao |
Direct link: https://paste.plurk.com/show/784546