SCE
Home
Categories
Python
C#
C++
C
Visual Basic
Java
JavaScript
HTML
CSS
SQL
Git
VIEW ALL
Other
Tags
What's Hot
Featured
I'm Feeling Lucky
Latest
SCE
Sign Up
Log In
printing a string backwards using parameter passing and pointers
Posted by
mark123
Last Updated:
March 05, 2012
#include<stdio.h>
#include<conio.h>
void rev( char *s )
{
if( ( *( s + 1 ) ) )
rev( s + 1 );
printf( "%c", *s );
}
int main()
{
char s[100];
printf("Enter a string:");
scanf( "%s", s );
rev( s );
getch();
return 0;
}
Related Content
C++ Printing Student Table Using iomanip
Samath
|
Jan 04, 2017
Palindrome program using pointers and string functions
mark123
|
Apr 19, 2015
C Program to Read integers into an array and Reversing them using Pointers
Samath
|
Jan 02, 2017
C program that reads parameter float (Vin) and a second parameter float (Vout ) and print the load resistor needed for this design with its unit
Samath
|
Jan 01, 2017
C Program to Compute sum of the array elements using pointers
Samath
|
Jan 02, 2017
JavaScript program that accepts an array as a parameter and returns an array of only even numbers extracted from the list
SceDev
|
Feb 17, 2024