11.07.2015 Views

Lista 03a - DCC/UFMG

Lista 03a - DCC/UFMG

Lista 03a - DCC/UFMG

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

16) Criar um algoritmo em PORTUGOL que imprima todos os números de 1 até 100,inclusive, e a soma de todos eles.algoritmo L3P016;varinteiro: C,SOMA;inícioSOMA ← 0;para C de 1 até 100 façaimprima(C);SOMA ← SOMA + C;fim-paraimprima("O valor da soma é: ",SOMA);fimprogram l3p016;varC,SOMA: integer;beginSOMA := 0;for C := 1 to 100 dobeginwriteLn(C);SOMA := SOMA + C;end;writeLn('O valor da soma eh: ',SOMA);end.SOMA = 0;for C = 1 : 100disp( C );SOMA = SOMA + C;endfprintf(1,'O valor da soma eh: %d\n',SOMA);<strong>UFMG</strong> – ICEx – <strong>DCC</strong> – Programação de Computadores – 2º. Sem 2005 – David Menoti 16

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!