/* C program to reverse a sentence entered by user using Recursion. */
#include <stdio.h>
void Reverse();
int main()
{
printf("Enter a sentence: ");
Reverse();
return 0;
}
void Reverse()
{
char c;
scanf("%c",&c);
if( c != '\n')
{
Reverse();
printf("%c",c);
}
}
Expected Output:
Enter a sentence: i am c programming
gnimmargorp c ma i
#include <stdio.h>
void Reverse();
int main()
{
printf("Enter a sentence: ");
Reverse();
return 0;
}
void Reverse()
{
char c;
scanf("%c",&c);
if( c != '\n')
{
Reverse();
printf("%c",c);
}
}
Expected Output:
Enter a sentence: i am c programming
gnimmargorp c ma i
Tags:
C program to reverse a sentence entered by user using Recursion.
recursion
Recursion in C
reverse a sentance
reverse a sentence