Sunday, 28 April 2013

C Program to Print a given String in Reverse order Using Pointers

By

Write a C Program to Reverse a String Using Pointers


Program:

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
clrscr();
char str[100];
char *strp,l;
int i;
printf("**************************");
printf("\nwww.flintgroups.com\n");
printf("**************************\n");
printf("Enter a String\n");
gets(str);
printf("The Reversed String is : ");
l=strlen(str);
strp=&str[l];
for(i=0;i<=l;i++)
{
printf("%c",*strp);
strp--;
}
getch();
}


Output

1 comment:

  1. Hello, that`s my first time visit at your blogger.
    Now i,m still a newbie as a blogger... in the processes of learning about the blogger..
    so i try to search people blogger from google..
    i hope i can learn from another blogger, how to be a good blogger and good writing...
    Thanks for alr give such a wonderfull blogger...

    If U Have Time Please Visit My Blog : Agen Judi Online

    ReplyDelete

Related Posts Plugin for WordPress, Blogger...

Labels