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
- Create a program that uses at least two functions that will be called from your main. This program is a number game program that asks for parts of your phone and after manipulati


Write a program that reads a line of characters from the user and displays that entire line after converting any uppercase characters to lowercase also change any lowercase charact

what is binary heap ? what is the c code for the implementation for the binary heap

WAP TO PRINT NUMBERS FROM 1-50 WHICH ARE DIVIDED BY 7 void main () { int a; clrscr (); a=1; while (a { if (a%7==0) printf ("%d\n",a); a++; } ge

what is classes?


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

What are compound statements? - Compound statements are made up of two or more program statements that are executed together. They may be executed with a loop. - Curly brack

padovan string program 1 : package test.padovanstring; public class PadovanString {     public int stringOccurrences(int n, String str){        if(n >= 40)     return -