Design a program using a one-dimensional array that will ask the user to give a series of numbers and then the program will check and determine which of the given number is the highest and lowest in terms of numerical value and then display the result on the screen.
If you like my work please click the ads on my website to support my work. I will really appreciate your help.
I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.
I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.
My mobile number here in the Philippines is 09173084360.
My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.
Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.
My personal website is http://www.jakerpomperada.com
Program Listing
/* highest_lowest.c
Author : Jake Rodriguez Pomperada,BSCS,MAED-IT
Date : November 29, 2018 Thursday 3:35 PM
Location : Bacolod City, Negros Occidental
Tool : Dev C++ Version 5.11
Website : http://www.jakerpomperada.com
Email : jakerpomperada@jakerpomperada.com and jakerpomperada@gmail.com
*/
#include <stdio.h>
int main ()
{
int arr[20], b=0, max=0, min=0;
printf("\n\n");
printf("\t\tHighest and Lowest Value Checker");
printf("\n\n");
printf("\tHow many items to be process? : ");
scanf("%d",&b);
printf("\n\n");
printf("\tEnter items values : ");
for (int a = 0; a < b; a++){
scanf("%d",&arr[a]);
}
max = arr[0];
for (int a = 0; a < b; a++)
{
if (max < arr[a])
max = arr[a];
}
min = arr[0];
for (int a = 0; a < b; a++)
{
if (min > arr[a])
min = arr[a];
}
printf("\n\n");
printf("\t===== DISPLAY RESULT =====");
printf("\n\n");
printf("\tThe Largest Value is %d.",max);
printf("\n\n");
printf("\tThe Smallest Value is %d.",min);
printf("\n\n");
printf("\tEnd of Program");
printf("\n\n");
}
No comments:
Post a Comment