Guest User

Untitled

a guest
Sep 25th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. #include<stdio.h>
  2. void main() {
  3. int i,arr[5],j,max;
  4. for(j=0;j<5;j++){
  5. printf("enter num %d: ",j+1);
  6. scanf("%d",&arr[j]);
  7. }
  8. for(i=0;i<5;i++){
  9. for(j=i+1;j<5;j++){
  10. if(arr[i]<arr[j]){
  11. max=arr[j];
  12. arr[j]=arr[i];
  13. arr[i]=max;
  14.  
  15.  
  16. }
  17.  
  18.  
  19. }
  20.  
  21.  
  22. }
  23. for(i=0;i<5;i++){
  24. printf("%d\n",arr[i]);
  25. }
  26.  
  27.  
  28. }
Add Comment
Please, Sign In to add comment