C program for reverse the string , C/C++ Programming

C Program for REVERSE THE STRING

#include stdio.h>

#include conio.h>

#include string.h>

void main()

{

          char name[30];

          char *s;

          int i,len;

          clrscr();

          printf("ENTER THE STRING: ");

          gets(name);

          len=strlen(name);

          s=&name[len-1];

          for(i=len-1;i>=0;i--)

 

          {

                   putchar(*s);

                   s--;

          }

          getch();

}

 

OUTPUT :

ENTER THE STRING : KAMLESH

HSELMAK

 

 

Posted Date: 9/10/2012 8:13:08 AM | Location : United States







Related Discussions:- C program for reverse the string , Assignment Help, Ask Question on C program for reverse the string , Get Answer, Expert's Help, C program for reverse the string Discussions

Write discussion on C program for reverse the string
Your posts are moderated
Related Questions
At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with thes

Virtual Webcam effects - Setup and Source code with Nice User Interface Project Description: I want a similar webcam effects application which can apply effects to webcam fee

.Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b.

Program to find a Greatest String: C - Program: Write a program find largest string by c program. int main( int argc, char *argv[] ) {     if( argc         {

What are the benefits of using friend classes? - Friend classes are useful when a class wants to hide features from users which are required only by another, tightly coupled cl


What are control structures? - Control structures decide which instructions in program must be executed. - This implies that program flow may not necessarily move from one s

Explain the working of strcmp and strcat Function? strcmp() : This function is meant to use to compare two strings. The strcmp() function acknowledge two strings as argument


Aim: To implement a program to convert distance given in feet and inches into meters and centimeters and vice versa. Code:                         class mcm; class