Programming Blog

This blog is about technical and programming questions and there solutions. I also cover programs that were asked in various interviews, it will help you to crack the coding round of various interviews

Sunday, 24 December 2017

C program to reverse the string using recursion

#include<stdio.h> 
void main()  
{  
 void reverse(void); 
   clrscr(); 
     printf("\nEnter sentence"); 
    reverse(); 
    getch();  
} 
   
 void reverse(void) 
   { 
    
 char c; 
     if((c=getchar())!='\n') 
 { 
            reverse(); 
            putchar(c); 
        return; 
     
} 
 
  }

No comments:

Post a Comment