ACCEPT 20 VALUES FROM THE USER & COUNT THE NEGATIVE VALUES ENTERED


#include<stdio.h>
#include<conio.h>
void main()
{
int a[20],i,ct=0;
printf("Enter 20 Values");
for(i=0;i<=19;i++)
  {
  scanf("%d",&a[i]);
  }
  for(i=0;i<20;i++)
    {
    if(a[i]<0)
     {
     ct++;
     }
    }
    printf("Negative Values=%d",ct);
getch();
}

0 comments: (+add yours?)

Post a Comment