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

Answer Posted / r.s.guptha

void reverse()
{
char c = getchar();
if(c=='\n' || c=='\r')
return;
else
reverse();
putchar(c);
}
int main()
{
reverse();
return 0;
}

Is This Answer Correct ?    4 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?

652


Why cant I open a file by its explicit path?

588


The performance of an operation in several steps with each step using the output of the preceding step a) recursion b) search c) call by value d) call by reference

668


Explain the difference between getch() and getche() in c?

558


Are bit fields portable?

669






What is property type c?

596


Explain how can I right-justify a string?

615


What is getch () for?

668


Do pointers need to be initialized?

556


Explain what does a function declared as pascal do differently?

630


What is the difference between declaring a variable by constant keyword and #define ing that variable?

2681


can we have joblib in a proc ?

1650


How do you define a function?

577


What is the symbol indicated the c-preprocessor?

688


What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?

599