Advertisement
Nayeemzaman

Untitled

Nov 1st, 2018
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int n,a[100],b[100],c[100],i;
  5. scanf("%d",&n);
  6. for(i=0; i<n; i++)
  7. {
  8. scanf("%d",&a[i]);
  9.  
  10. }
  11. printf("Positive = ");
  12. for(i=0; i<n; i++)
  13. {
  14. if(a[i]>0)
  15. {
  16. b[i]=a[i];
  17. printf("%d ",b[i]);
  18. }
  19. }
  20. printf("\nNegetive = ");
  21. for(i=0; i<n; i++)
  22. {
  23. if(a[i]<0)
  24. {
  25. c[i]=a[i];
  26. printf("%d ",c[i]);
  27. }
  28.  
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement