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
There are ''''n'''' ants on a ''''n+1'''' length rod. The ants are numbered from 1 to n and are initially placed at positions starting from position 1 till position n. They are mov


Explain the parts of operators Assignment Operators The equal (=) sign is used for assigning a value to another. The left hand side has to be a variable (lvalue, which exc

Question: (a) Describe what are dynamic pointers. Show their memory representations diagrammatically. (b) Write short notes about pointers in arrays, paying attention on

#quGiven the Array class definition in Fig. 11.10-11.11 (pp. 476-479) of the textbook, write a new overloaded operator function for the ‘%’ (modulus) operator (i.e., return an arra

The break statement The break statement, which was already covered in the switch.. case, can also be used in the loops. When a loop statement is encountered in the loops the co

The Special Pointer 'this' When various instances of a class come into existence, it naturally follows that each instance has its own copy of member variables. If this were not


Use 16 digit credit card numbers that contain 15 digits an 1 check digit. The format of the card number consists of the 15 digits followed by the check digit. The check digit is co

overloadstream insertion opertator to display the data of object on the console