SHARE
TWEET

Untitled

a guest Jun 19th, 2017 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {Desenvolvido por Heverton Freitas para a comunidade do Orkut Language:=PASCAL}
  2. program NumerosParesAteNum;
  3. uses Crt;
  4. var Num,Cont : integer;
  5.     Soma,Auxiliar : real;
  6. begin
  7.     ClrScr;
  8.     Soma:=0;
  9.     Auxiliar:=0;
  10.     write('Entre com um numero: ');
  11.     readln(Num);
  12.     for Cont:=1 to Num do
  13.     begin
  14.         if (Cont mod 2) = 0 then
  15.         begin
  16.             Soma:=Soma+Cont;
  17.             Auxiliar:=Auxiliar+1;
  18.         end;
  19.     end;
  20.     write('O resultado e: ',Soma/Auxiliar:0:0);
  21.     ReadKey;
  22. end.
RAW Paste Data
Top