Question:
Using C language, Write a program that will accept 5 numbers and will determine the lowest number.USE do while
benjie
2008-07-01 07:44:27 UTC
Using C language,

Write a program that will accept 5 numbers and will determine/print the lowest number USING do while or while "LOOPING"

Program simulation:
Program should accept a number 5 times
It should determine the lowest then store it then show the output.


Example.

Enter a number : 5
Enter a number : 20
Enter a number : 52
Enter a number : 3
Enter a number : 16

The lowest number is : 3

Use only c language not c++
simple program that kept me thinking
hope someone helps
Three answers:
2008-07-01 08:00:16 UTC
#include



main(){

int num[5],ctr=0,low,lowest;

clrscr();

do{

printf("Enter a number: ");

scanf("%d",&num[ctr]);

ctr++;

}while(ctr<5);

low=num[0];

for(ctr=0;ctr<5;ctr++){

if(num[ctr]
low=num[ctr];

}

printf("The lowest number is %d",low);

getch();

}
merwin
2016-10-21 04:44:46 UTC
No, yet i did attempt and a lot of circumstances to consume soup with a spoon, extremely if a soup is thick (you may thicken the soup efficiently with the aid of including some flour). It takes extra time, so I take excitement in it longer
VarmintHunter07
2008-07-01 08:13:16 UTC
int lowestNumber = MAX_INT;

int i = 0;



while ( i++ < 5 )

{

int thisNumber = 0;



printf( "Enter a number: " );

scanf( "%d", &thisNumber );



if ( thisNumber < lowestNumber )

{

lowestNumber = thisNumber;

}

}



printf( "Lowest number is %d", lowestNumber );


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...