You are here:

C/introduction to C programing

Advertisement


Question
if user gives you 5 numbers how you find the max and min number.structured english for answer please.
my answer is
get list of five numbers
calculate the max/ min number
print the max/min number

Answer
1. Min = 0, Max = 0;
2. Read the list of numbers into array a[5].
3. I = 0
4. For I = 0, I < 5,
5. Do
6.     If (a[I] < Min) Min = a[I].
7.     If (a[I] > Max) Max = a[I].
8. Done // End of For loop
9. Print "Maximum numer in the list is = " Max.
10. Print "Minimum numer in the list is = " Min.
11. End

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Narendra

Expertise

I can answer questions in C related to programming, data structures, pointers and file manipulation. I use Solaris for doing C code and if you have questions related to C programming on Solaris, I will be able to help better.

Experience

6.5

Organizations belong to
Sun Microsystems

Awards and Honors
Brain Bench Certified Expert C programmer.
Advanced System Software Certified

©2012 About.com, a part of The New York Times Company. All rights reserved.