C program for rotation, C/C++ Programming

void main()

{

          char a[100];

          int i,j,k,l;

          clrscr();

          printf("ENTER THE STRING: ");

          gets(a);

          l=strlen(a);

          l=l-1;

          for(i=0;i<=l;i++)

          {

                   k=a[0];

                             for(j=0;j

                             {

                                      a[j]=a[j+1];

                             }

                   a[j]=k;

                   printf("\n%s",a);

          }

          getch();

}

 

 

OUTPUT :

ENTER THE STRING: KAMLESH

HAMLESK

 

NO OF WORDS ARE 1


 

Posted Date: 9/10/2012 2:54:00 AM | Location : United States







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

Write discussion on C program for rotation
Your posts are moderated
Related Questions
A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

i need expression and its types with example programs in c++

Goals For this assignment you will write programs in C and LC-3 assembly code. Both programs will perform the identical recursive algorithm. The goals of this programming assignmen


Compiler Design - Limit In The Method Instructions

where to use tower of honoi?

Define the Processing of a Structure? The members of structure are typically processed individually as separate entities. So we must be able to access the individual structure

How to write an inline class member function In addition to global functions, you may request that non-static member functions of a class be inlined.  The normal method of doin

Program to convert fraction to decimal: int main() {                 float num, denom;     // numerator and denominator of fraction                 float value;

P o i n t e r d e c l a r a t i o n f o r C l a s s : M m; M * p m; / / C la ss M i s d e c l a r e d a s