Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main(){
  4. float num, maior, menor, soma;
  5. cout << "Informe o 1 º numero: ";
  6. cin >> num;
  7. maior = num;
  8. menor = num;
  9. soma = num;
  10. for(int i=2; i <=5; i++){
  11. cout << "Informe o " << i << "º numero: ";
  12. cin >> num;
  13. soma = soma + num; // soma += num;
  14. if (num > maior){
  15. maior = num;
  16. }
  17. if (num < menor){
  18. menor = num;
  19. }
  20. }
  21. cout << "maior numero: " << maior << endl;
  22. cout << "menor numero: " << menor<< endl;
  23. } cout << "soma dos numeros: " << soma<< endl;
  24. cout << "media dos numeros: " << soma/5<< endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement