Displaying Source Code(s)
|
|
Program to reverse the input string.
--------------------------------------------------------------------------------
#include <stdio.h>
#include <conio.h>
# define EOLN '
'
void reverse(void); /* function prototype */
void main()
{
char c;
clrscr();
printf(" Please enter a line of text below<BR>);
reverse();
printf("
is 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;
}
|
|
|