Posts

Showing posts with the label C program to print the values in descending order.

C program to print the values in descending order.

Image
  C PROGRAM  C program to print the values in descending order #include <stdio.h> #include<conio.h> void main() {   int a[30],n,temp,i,j;   clrscr();   printf("enter the values of N \n");   scanf("%d",&n);   printf("enter the numbers \n");   for(i=0;i<n;i++)   {     scanf("%d",&a[i]);     }     for(i=0;i<n;i++)     {       for(j=i+1;j<n;j++)       {         if(a[i]<a[j])         {           temp=a[i];           a[i]=a[j];           a[j]=temp;           }           }           }           printf("the number is arranged in descending order \n");           for(i=0;i<n;i++)          ...