Advertisement
_LoneWanderer_

Notas alunos

May 3rd, 2024
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.66 KB | Source Code | 0 0
  1. algoritmo "Notas alunos"
  2. var
  3.    notAlunos : vetor[1..4] de inteiro
  4.    i : inteiro
  5.    soma, maior, menor: inteiro
  6. inicio
  7.    soma <- 0
  8.    para i de 1 ate 4 faca
  9.       escreva ("digite a nota do alumo",i, ": ")
  10.       leia (notAlunos[i])
  11.       soma <- soma + notAlunos[i]
  12.       se i = 1 entao
  13.          maior <- notAlunos[i]
  14.          menor <- notAlunos[i]
  15.       senao
  16.          se notAlunos[i] > maior entao
  17.             maior <- notAlunos [i]
  18.          fimse
  19.          se notAlunos[i] < menor entao
  20.             menor <- notAlunos[i]
  21.          fimse
  22.       fimse
  23.       fimpara
  24.       Escreval ("Maior nota: ",maior)
  25.       Escreval ("Menor nota: ",menor)
  26.      
  27.  
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement