simple c++ program for "abcde123ba" convert "ab321edcba"
with out using string

Answer Posted / ragavan

#include<stdio.h>
#include<conio.h>
//Using recursive
void print( char c)
{
char a;
if(c=='\n')
return;
a=getchar();
print(a);
printf("%c",c);
return;
}

void main()
{
char c;
clrscr();
c= getchar();
print(c);
getch();
}

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we distribute function templates and class templates in object libraries?

791


Difference between inline functions and macros?

764


Define whitespace in C++.

953


What are advantages of using friend classes?

828


What is the use of register keyword with the variables?

743


What is the copy-and-swap idiom?

817


How does list r; differs from list r();?

897


How one would use switch in a program?

817


What are the c++ access specifiers?

1053


Can member data be public?

772


What is meant by the term name mangling in c++?

716


What is command line arguments in C++? What are its uses? Where we have to use this?

855


What is an object in c++?

816


What is private inheritance?

836


What is the advantage of c++ over c?

754