Untitled
unknown
plain_text
a year ago
486 B
6
Indexable
#include<stdio.h> void main(){ int i,j,n ; int temp,num[100]; printf("enter numbers of elements you want to sort"); scanf("%d",&n); printf("enter the numbers"); for(i=0;i<n-1;i++){ for(j=0;j<n-i-1;j++){ if(num[j]>num[j+1]) { temp=num[j]; num[j]=num[j+1]; num[j+1]=temp; } } } printf("the number is ascending order is %d",num[i]); }
Editor is loading...
Leave a Comment