12 June, 2016

C Program to Reverse a String without using STRREV function

C Program to Reverse a String without using STRREV function and using FOR loop
#include<stdio.h>
main()
{
char a[50];
int i;
clrscr();
printf("Enter any string: ");
scanf("%s", &a);
for(i=strlen(a)-1;i>=0;i--)
printf("%c",a[i]);
getch();
}
Output: 
Enter any string: KnowAjob
bojAwonK

No comments:

Post a Comment

If you need more information about any topic, feel free to comment here!