Explain the program given below. #include int main() { float numbers[5]; int j, pctr=0, nctr=0; printf("\nInput the first number: "); scanf("%f", &numbers[0]); printf("\nInput the second number: ");...


Explain the program given below.


#include
int main()
{
    float numbers[5];
 int j, pctr=0, nctr=0;
 printf("\nInput the first number: ");
    scanf("%f", &numbers[0]);
    printf("\nInput the second number: ");
    scanf("%f", &numbers[1]);
    printf("\nInput the third number: ");
    scanf("%f", &numbers[2]);
 printf("\nInput the fourth number: ");
    scanf("%f", &numbers[3]);
    printf("\nInput the fifth number: ");
    scanf("%f", &numbers[4]);
 for(j = 0; j < 5;="">
 {
  if(numbers[j] >= 0)
  {

   pctr++;
  }
  else if(numbers[j] <>
  {
   nctr++;
  }
 }
 printf("\nNumber of positive numbers: %d", pctr);
 printf("\nNumber of negative numbers: %d", nctr);
 printf("\n");
 return 0;
}



Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here