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
Many human diseases could be controlled by the knowledge of the gene’s structure and pattern. The human gene could be represented by four nucleotides. Each nucleotide is represente

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. The area under a curve between two points can b

Access to the channel/devices is achieved by means of general purpose I/O routines Theses are standard functions described in stdio.h header file namely getc and putc. Getc and put

write a c++ code to implement use of a constructor

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

Static Variables Static variables have the similar scope s automatic variables, but, unlike automatic variables, static variables retain their values over number of function ca

for different operation multiple stack

Define  T y pe c o m p a t i b i li t y? T o a s s i g n i n t t o s m a l l i n t t h e v a r i a b l e should b e

Introduction. In this assignment you are required to revisit the Assignment 1 topic. You will develop a new program which is more sophisticated, in particular, adding more functio

Project Description: I would like to be building regarding a complex mobile application build as we require the signing of an NDA. My firm in based in Montreal Canada and we are