EmbLogic's Blog

a prog. to find out Largest & smallest no. from given five no.s………..

1#include<stdio.h>
2 int main()
3 {
4 int x[5],l,s,i,j,k,z=0;
5 while(z<3)
6 {
7 printf(“\nenter any five numbers : “);
8 for(i=0;i<5;i++)
9 {
10         scanf(“%d”,&x[i]);
11 }
12 l=x[0];
13 s=x[4];
14 for(j=1;j<5;j++)
15 {
16  if(l<x[j])
17  {  l=x[j]; }
18 }
19 printf(“largest no. is : %d “,l);
20 for(k=0;k<4;k++)
21 {
22 if(s>x[k])
23 {
24 s=x[k];
25 }
26 }
27 printf(“smallest no. is : %d”,s);
28 z++;
29 } }

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>