Program to convert lower case to upper case and print them in to alphabetically order

#include
main()
{
char c1,c2,c3,c4,c5,c6;
printf("enter the charecters\n");
scanf("%c %c %c",&c1,&c2,&c3);
c4=c1-32;
c5=c2-32;
c6=c3-32;
if(c4>c5&&c4>c6)
{
if(c5>c6)
printf("%c %c %c\n",c6,c5,c4);
else
printf("%c %c %c\n",c5,c6,c4);
}
if(c5>c4&&c5>c6)
{
if(c4>c6)
printf("%c %c %c\n",c6,c4,c5);
else
printf("%c %c %c\n",c4,c6,c5);
}
if(c6>c4&&c6>c5)
{
if(c4>c5)
printf("%c %c %c\n",c5,c4,c6);
else
printf("%c %c %c\n",c4,c5,c6);
}

}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s