Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need the provided code to print a error message for indistinct variables as stated above and prompt the user the re enter a variable. C

image text in transcribed

Need the provided code to print a error message for indistinct variables as stated above and prompt the user the re enter a variable. C programming. Simple functions, no arrays. Any other fixes also appreciated

#include #include int main() { int i; float n, value, min = 9999, max = -9999; for (i = 1; i max) { max = value; } }

printf("The maximum is %f and the minimum is %f", max, min); return 0; }

Q3. Write a program that receives 4 distinct real values from a user and finds the maximum and the minimum. If the numbers are not distinct then print an error message saying that the entered values are not distinct and ask the user to input it again. (50) Sample output: (not covered all Inputs scenarios) Enter number 1: 10 Enter number 2: 20 Enter number 3:30.5 Enter number 4:10.5 The maximum is 30.50, The minimum is 10.00

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management System MCQs Multiple Choice Questions And Answers

Authors: Arshad Iqbal

1st Edition

1073328554, 978-1073328550

More Books

Students also viewed these Databases questions

Question

Briefly describe how CSMA/CD works.

Answered: 1 week ago