You are here:

C/Puesdo code

Advertisement


Question
Hi, I am trying to write some Puesdo code to show the design for a program that scans for the lowest variable in an interger array and displays it. Please could you help me!

I have been told a similar program will be on my exam next week and I could really do with a example as I am terrible at Puesdo code.

Thankyou,

Thamim

Answer
1. var array[1 to n]
2. var smallest_number = array[1]
3. var i = 2;
4. Repeat steps 4 to 8
5.   if (smallest_number > array[i])
6.      smallest_number = array[i]
7.      i = i + 1;
8.   if (i > n) goto step 10
9.   else goto step 5
10. Display smallest_number
11. Stop

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.