nikolas_serafini

Lista 3 - Exercício 44

Jun 15th, 2013
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     int i,quantity,counter = 0;
  6.     float number;
  7.  
  8.     printf("Entre com a quantidade de valores a serem lidos :\n");
  9.     scanf("%d",&quantity);
  10.  
  11.     for (i = 0; i < quantity; i++)
  12.     {
  13.         printf("Entre com o o valor :\n");
  14.         scanf("%f",&number);
  15.         if (number < 0)
  16.         {
  17.             counter++;
  18.         }
  19.     }
  20.     printf("%d valores negativos!\n",counter);
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment