Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(){
- float num, maior, menor, soma;
- cout << "Informe o 1 º numero: ";
- cin >> num;
- maior = num;
- menor = num;
- soma = num;
- for(int i=2; i <=5; i++){
- cout << "Informe o " << i << "º numero: ";
- cin >> num;
- soma = soma + num; // soma += num;
- if (num > maior){
- maior = num;
- }
- if (num < menor){
- menor = num;
- }
- }
- cout << "maior numero: " << maior << endl;
- cout << "menor numero: " << menor<< endl;
- } cout << "soma dos numeros: " << soma<< endl;
- cout << "media dos numeros: " << soma/5<< endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement