Ex: Write a C Program To Reverse the String without using "strrev()" function. How to write a C Program To Reverse the String without using "strrev()" function. C Program To Reverse the String without using "strrev()" function.
Program:
#include<stdio.h>
#include<string.h>
void main()
{
char a[100],b[100];
int i,j,len;
printf(" \n Please Enter Any String : ");
gets(a);
j=0;
#include<stdio.h>
#include<string.h>
void main()
{
char a[100],b[100];
int i,j,len;
printf(" \n Please Enter Any String : ");
gets(a);
j=0;
/*Calculate length of string using strlen() function and store result in variable len*/
len=strlen(a);
len=strlen(a);
//Run for loop from len-1 to 0.
for(i=len-1;i>=0;i--)
{
No comments:
Post a Comment
If you have any doubts, please discuss here...👇