Friday 7 September 2012

Array029

Input five numbers in an array. Write a program to find the minimum value in that array.

#include <stdio.h>
#include <conio.h>

void main ( )
{
            int        co, no[5], min;
            clrscr ( );
                           
            for ( co = 0; co < 5; co++ )
            {                                      
                               printf ("\n\t\t\t Enter a number...........:"); scanf ("%d", &no[co]);
            }                           
                                          
            min = no[0];
            for ( co = 0; co < 5; co++ )
            {                                          
                               if ( min > no[co] )
                               {                                 
                                            min = no[co];
                               }
            }
            printf("\n\n\n\t\t\t The Minimum value is = %d", min );
            getch ( );
}
Click here to contact us

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...