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
Explain how do you determine the length of a string value that was stored in a variable?
What is a dynamic array in c?
Is flag a keyword in c?
Is main a keyword in c?
What is the difference between new and malloc functions?
What is the difference between malloc() and calloc() function in c language?
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
Can a pointer be null?
Which programming language is best for getting job 2020?
What do the functions atoi(), itoa() and gcvt() do?
What is the scope of an external variable in c?
What is the scope of global variable in c?
Can the size of an array be declared at runtime?
Is calloc better than malloc?
Which is the best website to learn c programming?