Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need the CORRECT code for this program. Also, PLEASE answer the question in a

ID: 3833772 • Letter: I

Question

I need the CORRECT code for this program. Also, PLEASE answer the question in a sentence. Im attaching the sample code with the description. Thank you.

Description: Write a C program that prompts the user to input five different positive integers at the same time, then computes and displays the results shown below in the sample outputs. The outputs of your program should be in the same order as given in the sample outputs. Your program should end by displaying a Program Terminted message. Sample outputs of the program: warsaw 167 /a out. Enter five different positive integers 1 2 3 4 5 There are 2 even integers in the input. The largest even integer in input is 4 The even integers are 2 4 Program Terminated Warsaw 168 ./a.out Enter 5 different positive integers 1 3 5 79 There are no even integers in the input. The largest even integer in input is: None Program Terminated warsaw 169 /a out. Enter 5 different positive integers 2 4 6 8 10 There are 5 even integers in the input. The largest even integer in input is: 10 The even integers are 2 4 6 8 10 Program Terminated Warsaw 170

Explanation / Answer

#include <stdio.h>

int main()
{
   int r = 5,i;
   int max=-1;
   int a[r],b[r];
   int count=0;
   printf("Enter %d different positive integers: ",r);
   for(i=0;i<r;i++)
   {
       scanf("%d",&a[i]);
       b[i]=0;
       if(a[i]%2==0)
       {
           b[i]=1;
           count++;
           if(max<a[i])
           {
               max = a[i];
           }
       }
   }
   if(count==0)
   {
       printf("There are no even integers in the input. ");
   }
   else
   {
       printf("There are %d even integers in the input. ",count);
   }
   if(max==-1)
   {
       printf("The largest number in the input is: None ");
   }
   else
   {
       printf("The largest number in the input is: %d ",max);
       printf("The even integers are: ");
       for(i=0;i<r;i++)
       {
           if(b[i]==1)
           {
               printf("%d ",a[i]);
           }
       }
       printf(" ");
   }
   return 0;
}

//Yes the algorithm even there are 5000 integers. You just need to change r = 5000 from r=5.