Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- main() {
- int idade, soma=0, media, menor, maior, cont=0;
- printf("Informe sua idade:");
- scanf("%d", &idade);
- maior = idade;
- menor = idade;
- while(idade!=0) {
- cont++;
- soma +=idade;
- if(idade>maior) {
- maior=idade;
- }
- if(idade<menor) {
- menor = idade;
- }
- printf("Informe sua idade:");
- scanf("%d", &idade);
- }
- media = soma/cont;
- printf("Idade media: %d", media);
- printf("Numero de pessoas: %d", cont);
- printf("Maior idade: %d", maior);
- printf("Menor idade: %d", menor);
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement