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
Explain string constants in c language - Escape Sequences? Illustrations are "945", "hello", "well done", "5+3". The character constant (example 'x') isn't equivalent to the st

Question: (a) Explain a linked list. (b) Describe the three different types of linked list with the help of diagrams. (c) Give two advantages and two disadvantages

processing two jobs through 2 machine

Normal 0 false false false EN-IN X-NONE X-NONE MicrosoftInternetExplorer4

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

What is the difference between JavaScript and PHP? The difference lies with the execution of languages. PHP is server side scripting language, which means that it cannot intera

wap to cheak if a number is palindrom

(a) Write a procedure called (add x y) that adds two numbers in a recursive manner. Specifically, note that x + y = (x + 1) + (y - 1) and x + 0 = x. (b) Using the substitution m

Many modern cryptography algorithms require two numbers that are coprime, or sometimes referred to as relatively prime. Two numbers are coprime if their greatest common divisor is