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
Explain about Evaluation of Expression in c language? An Expressions are evaluated using an assignment statement of the form: variable = expression; The Variable is any v


C Programming and Data Structures 1. Define and explain flow chart with an example. 2. Write an algorithm to print all even numbers in descending order and draw the flowcha

Write a Program to illustrate Array? int x[100]; char text[80]; float temp[30]; static int marks[5]; We are able to use symbolic constants instead of expression. The valu

A conversion constructor declared with the explicit keyword. The compiler does not use an explicit constructor to execute an implied conversion of types. Its purpose is reserved ex

Overall Program Objective: You will design and simulate a basic RISC processor.   You will create and encode an instruction set.  Your final task will be to "compile" a program

Program1: Write a program to find the factorial of a given number. The input is user given. Final output is printed out on to the screen. Program2: Write a program to gene

Structures A structure is a user-defined data type, which may have different data types as its members. Creating a structure is a two-part process. First, a structure template

Your program should use the Free Pascal compiler or the Lazarus IDE described in CSC 540. When you hand in your assignment to the digital dropbox, it should be a .PAS file, not zip

Automatic Variables Automatic variables are variable which are explained within the functions. They lose their value when the function terminates. It can be accessed only in th