Answers for "Lowest Number sample program in c++"

C++
0

Lowest Number sample program in c++

#include <stdio.h>
#include <conio.h>
void main();
{
	int val[10],h,l,i;
	clrscr();
	for(i=0;i<10;i++)
        {
		printf("\nENTER VALUE-%d: ",i+1);
		scanf("%d",&val[i]);
	}
	l=val[0];
	h=val[0];
	for(i=0;i<10;i++)
        {
		if(val[i]>h)
			h=val[i];
		else
                {
			if(val[i]<l)
				l=val[i];
		}
	}
	printf("\nHIGHEST VALUE IS %d",h);
	printf("\nLOWEST VALUE IS %d",l);
	getch();
}
Posted by: Guest on October-06-2021

Browse Popular Code Answers by Language