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

How do I write this program? Out of town on a family issue and need help. Thank

ID: 3702139 • Letter: H

Question

How do I write this program? Out of town on a family issue and need help. Thank you.

For this program, you will allow the user to enter four numbers and then determine the largest and smallest of the entered values Export PDF Adobe ExportPDF Convert POF files to Word or Excel The output of the program should look something like this: 2 1300-Assign -15-Peil-Lar.. Enter first number: 100 Enter second number: 120 Enter third number: -1234.331 Enter fourth number: 21.12 Convert To Mic rosoft Word .dood Recognce Tot English(US) LRG:120 Convert SML: -1234.331 e Create PDF Edit PDF The largest number should be listed first and be labeled with LRG: . The smallest number should be listed next and be labeled with SML: + Combine PDF Send Files Store Files Points to Think About ossiblylogica There are different ways to approach this solution, utilizing if. if / else , and p operators Use only materials covered though lecture 21, as this program does not require loops from lecture 22 . Depend ing on how you approach your solution, your program could require a number of variables to be created. Your program could utilize one variable for each of the inputs, one variable for the largest and one variable for the smallest. 624 AM

Explanation / Answer

#include <stdio.h>

int main()
{
float n1,n2,n3,n4, max, min;
float a[4];

printf ("Enter first number: ");
scanf ("%f", &n1);
printf ("Enter second number: ");
scanf ("%f", &n2);
printf ("Enter third number: ");
scanf ("%f", &n3);
printf ("Enter forth number: ");
scanf ("%f", &n4);

a[0]=n1;
a[1]=n2;
a[2]=n3;
a[3]=n4;

max=min=a[0];
for(int i=1;i<4;++i)
{
if(a[i]>max)
max=a[i];
if(a[i]<min)
min=a[i];
}
  
printf(" LRG: %0.3f",max);
printf(" SML: %0.3f",min);

  
return 0;
}

output >>>>>>>>>

Enter first number: 12 00
Enter second number: 120
Enter third number: -1234.331
Enter forth number: 21.12

LRG: 120.000
SML: -1234.331

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote