
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Write a C program that will print the entered alphabets in their descending order by using their ASCII codes.
//Name:Syed Hassam Badar //Section:B //Form No:EL-042- #include<conio.h> #include<stdio.h> void main(void) { clrscr(); char arr[5],temp; int a,b; for(a=0;a<=4;a++) { printf("\nEnter the Letter="); arr[a]=getche(); } for(a=0;a<=4;a++) { for(b=a+1;b<=4;b++) { if(arr[a]<arr[b]) { temp=arr[a]; arr[a]=arr[b]; arr[b]=temp; } } } printf("\nThe descending order is"); for(a=0;a<=4;a++) { printf("\n%c",arr[a]); } getche(); }