// ------------------------------------------------------ // Title : Find out smallest Number From Array // smallest - It Stores the smallest number // ------------------------------------------------------ #include#include void main() { int a[30],i,n,smallest; printf("\n Enter no of elements :"); scanf("%d",&n;); /* read n elements in an array */ for(i=0 ; i 〈 n ; i++) scanf("%d",&a;[i]); smallest = a[0]; for(i = 0 ;i 〈 n ; i++) { if ( a[i] 〈 smallest ) smallest = a[i]; } /* Print out the Result */ printf("\nSmallest Element : %d",smallest); getch(); }

0 Comments:
Post a Comment
Your Feedback :This is Growing Site and Your Feedback is important for Us to improve the Site performance & Quality of Content.Feel Free to contact and Please Provide Name & Contact Email