Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream.h>
- #include<conio.h>
- #define n 4
- void main()
- {
- int i;
- float small, balance[n]={199,3,7.6,-8};
- small=balance[0];
- clrscr();
- for(i=0; i<n; i++)
- cout<<balance[i]<<" ";
- //another loop do the array element comparing
- for(i=0; i<n; i++)
- {
- if(small>balance[i])
- small=balance[i];
- }
- cout<<"\n searching..."<<endl;
- //for result presentation
- cout<<" the smallest value in the given array is ="<<small<<endl;
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment