Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int i,n,num;
- printf("Enter number ::");
- scanf("%d",&n);
- long int max=-9999,min=9999;
- for(i=0;i<n;i++)
- {
- scanf("%d",&num);
- if(num>=max)
- {
- max=num;
- }
- if(num<=min)
- {
- min=num;
- }
- }
- printf("Max is%d and min is %d",max,min);
- return 0;
- }
Add Comment
Please, Sign In to add comment