Write a C-prog to accept a String and print reverse of it


#include<stdio.h>
#include<conio.h>
#include<string.h>
 
void main()
{
 char a[80];
 int i,j;
 clrscr();
 printf("Enter a string\n");
 gets(a);
 for(i=0;a[i]!='\0';i++);
for(--i;i>=0;i--)
 printf("%c",a[i]);
 getch();
}

1 comment:

Related Post

Array:
String functions:
General (Loops-for/while)
Write a Program to print reverse of a given number Write a Program to print Product of Digits (eg. 212=2*1*2=4) of a given number Write a C++ Program to Convert Binary into Decimal Number