#include<conio. h>
#include<stdio. h>
#include<string .h>
int main()
{
char A[40],B[40];
char ch;
int size,i,j;
puts("plese enter the string to be reversed");
gets(A);
puts(A);
ch='\0';
size=strchr(A,c h)-A;
printf("%d",siz e);
j=0;
for(i=size;i<0; i--)
{
B[j]=A[i];
j++;
}
puts(B);
getch();
i am trying ti reverse the string A and trying to store it in the string B but i am unable to be that is there any logical eror or some other error because no syntax error is there and i just wat to reverse the string A and want to stor it in the B using this for loop
regards
#include<stdio. h>
#include<string .h>
int main()
{
char A[40],B[40];
char ch;
int size,i,j;
puts("plese enter the string to be reversed");
gets(A);
puts(A);
ch='\0';
size=strchr(A,c h)-A;
printf("%d",siz e);
j=0;
for(i=size;i<0; i--)
{
B[j]=A[i];
j++;
}
puts(B);
getch();
i am trying ti reverse the string A and trying to store it in the string B but i am unable to be that is there any logical eror or some other error because no syntax error is there and i just wat to reverse the string A and want to stor it in the B using this for loop
regards
Comment