nikolas_serafini

Lista 2 - Exercício 7

May 24th, 2013
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     int counter = 0;
  7.     float a,b,c,d,e;
  8.  
  9.     printf("Entre com cinco valores :\n"); scanf("%f %f %f %f %f",&a,&b,&c,&d,&e);
  10.  
  11.     if (a<0) counter++;
  12.     if (b<0) counter++;
  13.     if (c<0) counter++;
  14.     if (d<0) counter++;
  15.     if (e<0) counter++;
  16.  
  17.     printf("Dos valores inseridos, %d sao negativos!\n",counter);
  18.  
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment