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
The default Constructor and Destructor If you fail to write a constructor and destructor function,  the compiler automatically supplies them for you. These functions have publi

Implementation of the Definition class: void Definition::put_word(char *s) {    word = new char[strlen(s)+1];    strcpy(word,s);    nmeanings = 0; }   voi

world wide web commands

write a program that counts the number of occurrences of the string in the n-th padovan string p(n)   program 1 : package test.padovanstring; public class PadovanString {

It is standard on functions to provide some indication that the function has succeeded in its operation. Consider the Scanf function:     scanf("%d",&number1);   If the functio


Can I explicitly call a destructor if I've allocated my object with new?

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

Write C code for a program that implements a digital clock (HH:MM:SS). The clock includes a two-digit hour indicator HH (00-23), a two-digit minute indicator MM (00-59), and a t

Normal 0 false false false EN-US X-NONE X-NONE