//Program to enter line using getchar and print it using putchar function.
#include<stdio.h>
#include<conio.h>
void main()
{
int i=0,j;
char c[50],ch;
clrscr();
printf("\n Enter the line: ");
while(ch!='\n')
{
ch=getchar();
c[i]=ch;
i++;
}
printf("\n Entered line is :");
for(j=i-1;j>=0;j--)
{
putchar(c[j]);
}
getch();
}
#include<stdio.h>
#include<conio.h>
void main()
{
int i=0,j;
char c[50],ch;
clrscr();
printf("\n Enter the line: ");
while(ch!='\n')
{
ch=getchar();
c[i]=ch;
i++;
}
printf("\n Entered line is :");
for(j=i-1;j>=0;j--)
{
putchar(c[j]);
}
getch();
}