Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int i,quantity,counter = 0;
- float number;
- printf("Entre com a quantidade de valores a serem lidos :\n");
- scanf("%d",&quantity);
- for (i = 0; i < quantity; i++)
- {
- printf("Entre com o o valor :\n");
- scanf("%f",&number);
- if (number < 0)
- {
- counter++;
- }
- }
- printf("%d valores negativos!\n",counter);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment