Advertisement
PROFESSOR_AIH

Positive numbers

Mar 28th, 2022
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.27 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int i,count=0;
  5.     double num;
  6.     for(i=1; i<=6; i++)
  7.     {
  8.         scanf("%lf",&num);
  9.         if(num>0)
  10.         {
  11.             count++;
  12.         }
  13.         num=0;
  14.     }
  15.     printf("%d valores positivos\n",count);
  16.     return 0;
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement