Advertisement
luisphelipe

listab_fix01

Mar 26th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. main(){
  4.     int n, ultimo, atual, crescente = 1;
  5.     printf("Quantos numeros serao digitados? ");
  6.     scanf("%d", &n);
  7.  
  8.     printf("Digite um numero: ");
  9.     scanf("%d", &ultimo);
  10.  
  11.     for(n; n > 1; n--){
  12.         printf("Digite um numero: ");
  13.         scanf("%d", &atual);
  14.  
  15.         if(atual < ultimo) crescente = 0;
  16.         ultimo = atual;
  17.     }
  18.     if(crescente) printf("e crescente");
  19.     else printf("nao e crescente");
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement