Sunday 11 December 2011

Write a program to print the elements Array and find out the minimum number in c

#include
#include
void main()
{
int arr[10];
int i,temp;
clrscr();
printf("enter the elements in the array:\n");
for(i=0; i<10; i++) { scanf("%d",&arr[i]); } temp=arr[0]; for(i=1; i<10; i++) { if(temp>arr[i])
temp=arr[i];
}
printf("the minimum number is:%d",temp);
getch();
}



OUTPUT


Enter the elements in the Array :

1
5
9
4
3
6
4
8
2
4

The minimum number is : 2

No comments:

Post a Comment