write a program in reverse the string without using
pointer,array,global variable declaration,lib fun only using
a function?

Answer Posted / sanjay

#include<stdio.h>
int main()
{
char a[10],b[10];
int i,c=0;
printf("Enter string");
scanf("%s",a);
for(i=0;a[i]!='\0';i++)
{
c=c+1;
}
for(i=c-1;i>=0;i--)
{
b[j]=a[i];
j++;
}
b[j]='\0';

printf("Reverse the string %s",b);
return 0;
}

Is This Answer Correct ?    6 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how do you determine the length of a string value that was stored in a variable?

672


What is a dynamic array in c?

599


Is flag a keyword in c?

682


Is main a keyword in c?

635


What is the difference between new and malloc functions?

582






What is the difference between malloc() and calloc() function in c language?

607


i = 25;switch (i) {case 25: printf("The value is 25 ");case 30: printf("The value is 30 "); When the above statements are executed the output will be : a) The value is 25 b) The value is 30 c) The value is 25 The value is 30 d) none

650


Can a pointer be null?

567


Which programming language is best for getting job 2020?

611


What do the functions atoi(), itoa() and gcvt() do?

726


What is the scope of an external variable in c?

571


What is the scope of global variable in c?

560


Can the size of an array be declared at runtime?

612


Is calloc better than malloc?

580


Which is the best website to learn c programming?

585