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
A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the asci

Write a program that predicts users age: Write a program that predicts users' age (0-128 years old) with at most 7 questions. The game starts with asking the user whether he/s

1. Jewels can only be removed for polishing from either end of the necklace (i.e. head or tail) 2. Once a jewel type is removed from the necklace, all other instances of the same j

Explain the terms- Substitutability and Extensibility Substitutability - The objects of a properly derived class can be safely and easily substituted for an object of its

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

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

Aim: To implement a program to allocate memory dynamically for 2 dimensional array (accept and print matrix) using pointers. Code:                       #include #inc

Explain Processing A Data File? Mainly data file applications needs that a data file be altered as it is being processed. For instance in an application involving the processin

Primarily the term alignment refers the tendency of an address pointer value to be a multiple of some power of two. Thus a pointer with two byte alignment contains a zero in the le

Write a program that finds the minimum total number of shelves, including the initial one required for this loading process.