This program is about arranging the given array values in descending order using for loop
#include<stdio.h> int main() { int s=0,i,n,a[10],t=0,j; printf("ENTER LIMIT:"); scanf("%d",&n); printf("ENTER VALUES:"); for(i=0;i<n;i++) { scanf("%d",&a[i]); } for(i=0;i<n;i++) { for(j=0;j<n;j++) { if(a[i]>a[j]) { t=a[i]; a[i]=a[j]; a[j]=t; } } } printf("THE DESCENDING ORDER IS"); for(i=0;i<n;i++) { printf("\n%d",a[i]); } return 0; }To download raw file Click Here
ENTER LIMIT:5 ENTER VALUES:7 2 4 1 6 THE DESCENDING ORDER IS 7 6 4 2 1
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions