|
Get 9,000+ Interview Questions with Answers in an eBook
C Source Codes List | Source Code Home
Program : Program to reverse the i/p string.
/* Prg. to reverse the i/p string */
#include
#include
# define EOLN '\n'
void reverse(void);
void main()
{
char c;
clrscr();
printf("\tPlease enter a line of text below\n");
reverse();
printf(" \n\tis the reversed form.");
getch();
}
void reverse(void)
/* read a line of characters & write it out backwards */
{
char c;
if ((c=getchar())!=EOLN)
reverse();
putchar(c);
return;
}
C Source Codes List | Source Code Home
|
|
|