SHARE
TWEET

Untitled

a guest Oct 22nd, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     int v[100], n, i, nn, np;
  6.     printf("n="); scanf("%d", &n);
  7.     for(i = 0; i<n; i++){
  8.         printf("v[%d] = ", i);
  9.         scanf("%d", &v[i]);
  10.     }
  11.     nn = 0; np =0;
  12.     for (i = 0; i<n; i++)
  13.         if (v[i] < 0) nn++;
  14.          else
  15.         if (v[i] > 0) np++;      
  16.    
  17.     printf("%d\n %d %d", n, nn, np);
  18.     return 0;
  19.    
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top