How to write a C Program To Reverse The String Using Pointer in C Programming Language ?
Solution For C Program :
/*C Program To Reverse The String Using Pointer.*/
#include<stdio.h>
#include<conio.h>
void reverse(char *);
void main()
{
clrscr();
char st[10];
gets(st);
printf("reverse=");
reverse(st);
printf("\noriginal data=%s",st);
getch();
}
void reverse(char *s)
{
char c;
if (*s==NULL)
{
return;
}
c=*s;
s++;
reverse(s);
printf("%c",c);
}
You may also learn these C Program/Code :
C Program To Swap Two Numbers Without Using Third Variable
Learn More :
String
- Write a c program to check given string is palindrome number or not.
- C Program to Convert Text String to Binary
- C Program String - Alphabet Count Example
- C Program String Example
- C Program String Count Example
- C Program String Example
- C Program to Print a String Without Use Semicolon.
- C Program To Find Length Of A String Including Blank Spaces, Tabs, And Other Special Characters
- C Program To Find Length Of String And Concatenate Two Strings
- C Program To Find The Length, Reverse Of A String And To Check It Is Palindrome or Not
- C Program To Print String In Formatted Output Form
- C Program Concatenating Two Strings Into A Third System
- C Program Date from string DDDD-DD-DD
- BUILDS A STRING FROM THE LSB BITS OF EACH PIXEL
- C Program Finds Sub-String Search in String
- C Program to concatenate two strings without using string functions
- C Program to Count Vowels, Consonants and Spaces in a string
- C Program to convert a string to upper case
- C Program Performs a search and replace for a specified target and replacement string
- C Program Anagrams
- C Program to find string length without library function
- C Program to Check Given String is Palindrome or Not
- C Program to Converts a Number to a String.
- Design a C function that shortens a string to 8 characters
Pointer
- C Program Pointer Example
- C Program to Find max and min in array using pointer concept
- C Program to Adds literal to list of literals
- C Program to find smallest in an array using pointer
- C Program A simple demonstration of using pointers to determine which function to use
- C Program LEXICAL ANALYSER
- C Program Simple linked list
- File Handling (console to file) in C Program
Reverse
- C Program to Reverse a Word
- C Program Array Example: Reverse
- C Program To Find Reverse Of Any Digit Number
- C Program To Find The Length, Reverse Of A String And To Check It Is Palindrome or Not
- C Program To Reverse A Number
- C Program To Sort An Array Of Names In Alphabetical And Reverse Order
- C Program To Reverse A Given Number
- C Program To Reverse A Number
- C Program to Reversing a Five Digit Integer Number
- C program to reverse an array elements using Dynamic Memory Allocation
- C Program to accept n numbers from user store these numbers into an array & reverse an array elements using function
- Creation and Display of Elements in Both Forward and Reverse Direction in a Doubly Linked List
- Input Number and Print it's Reverse C Program