Reginaldojs

exercicio 46,lista 3

Jun 15th, 2012
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. int main(){
  4.     int i,n,maior=0,menor=1000;
  5.     printf("digite 50 valores:\n");
  6.     for(i=0;i<50;i++){
  7.                       scanf("%d",&n);
  8.                       if(menor>n)
  9.                       menor=n;
  10.                       if(maior<n)
  11.                       maior=n;
  12.                       }
  13.                       printf("o maior valor sera %d\n\n",maior);
  14.                       printf("o menor valor sera %d\n\n",menor);
  15.     system ("pause");
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment