#include
#include
void main()
{
int i,max,min,max_index,min_index;
int num[10];
clrscr();
printf("\n\n\n\t Program for finding Maximum & Minimum number from an
array");
printf("\n\n\n\t\t\t Enter any 10 Numbers");
for(i=0;i<10;i++)
{
printf("\n\n\t\t\t Enter number for num[%d] = ",i);
scanf("%d",&num[i]);
}
max=0;
min=num[0];
for(i=0;i<10;i++)
{
if(num[i]>max)
{
max=num[i];
max_index=i;
}
if(num[i]<=min)
{
min=num[i];
min_index=i;
}
}
printf("\n\n\t\t\t Maximum number is %d at index %d",max,max_index);
printf("\n\n\t\t\t Minimum number is %d at index %d",min,min_index);
getch();
}
Related Links :
History Of C..
In the beginning was Charles Babbage and his Analytical Engine, a machine
he built in 1822 that could be programmed to carry out different computations.
Move forward more than 100 years, where the U.S. government in
1942 used concepts from Babbage’s engine to create the ENIAC, the first
modern computer.
Meanwhile, over at the AT&T Bell Labs, in 1972 Dennis Ritchie was working
with two languages: B (for Bell) and BCPL (Basic Combined Programming
Language). Inspired by Pascal, Mr. Ritchie developed the C programming
language.
My 1st Program...
#include
#include
void main ()
{
clrscr ();
printf ("\n\n\n\n");
printf ("\t\t\t*******Pankaj *******\n");
printf ("\t\t\t********************************\n");
printf ("\t\t\t\"Life is Good...\"\n");
printf ("\t\t\t********************************");
getch ();
}
Next Step...
#include
#include
void main ()
{
clrscr ();
printf ("\n\n\n\n\n\n\n\n");
printf ("\t\t\t --------------------------- \n\n");
printf ("\t\t\t | IGCT, Info Computers, INDIA | \n\n");
printf ("\t\t\t --------------------------- ");
getch ();
}
Thanks Yarr add some program on trignometric Function..
ReplyDeletethank you
ReplyDeleteThanks Good Collection Keep it Up....
ReplyDeleteThanks Friends For Your Appreciations...
ReplyDeleteThanks Brother..Really Big Collection..Keep it Upe..Add Some Projects Please..
ReplyDeletei think this program is good but can you help me to write this same program in C++ lanuguage.............as soon as possible....
ReplyDeletethanks this program is also beneficial for me.......
thankz 22222222222222222 mch sir with the help of you and this program i hadn't faced any sort of problem thankz again
ReplyDeletehere always the min value is 0 ? :0
ReplyDeleteit awesomely works...ty
ReplyDeletethank u...........
ReplyDeleteprogram find max and min m*n matrix Sagar Zodage
ReplyDeleteif u want to any program solution then mail me zodagesagar@gmail.com
#include
#include
void main()
{
int m,n,i,j;
int a[50][50];
int max,min;
clrscr;
printf("\n Enter M * N ");
scanf("%d%d",&m,&n);
for(j=0;jmin) min=a[j][i];
}
}
printf("\n The Max Number Is=%d",max);
printf("\n The Min Number Is=%d",min);
getch();
}