Program for Encoding & Decoding a Line of text.

#include <stdio.h>
#include <conio.h>
void main()
{
char str[80],ch;
int len=0,i=0;
clrscr();
printf("\n\n\n\t\t\t Program for Reversing a line of text");
printf("\n\n\n\t\t\t Enter a line of Text:");
printf("\n\t >> ");
fflush(stdin);
scanf("%[^'\n']",str);

i=0;
while(str[i]!='\0')
{
len++;
i++;
}
len=len-1;
printf("\n\n\t Reverse = ");
for(i=len;i>=0;i--)
{
ch=str[i];
if(ch>=97 && ch<=123)
ch=ch-32;
printf("%c",ch);
}

getch();
}

No comments:

Post a Comment

kiss on google ads if you are anonymous because your ip is trackable.thank you.

......from.admin