C Programming
Computer Programming

C Program using function to Reverse a sentence using recursion



Write a Program in C using function to Reverse a sentence using recursion

\* C Program using function to Reverse a sentence using recursion *\

# include < stdio.h >
# include < conio.h >
void   reverseSentence() ;

int   main( )
{

printf("Enter a Sentence: ") ;
reverseSentence() ;
return 0 ;

}

void   reverseSentence()
{

char c ;
scanf( "%c", &c ) ;
if( c != '\n' )
{
      reverseSentence() ;
      printf("%c",c) ;
}

}

Output of Program :

Output of C Program using function to Reverse a sentence using recursion