answersLogoWhite

0


Best Answer

#include<stdio.h>

#include<string.h>

int main()

{

char a[80];

int rotated_element_number[80];

int rotation;

int i;

int length;

printf("enter the word: \n");

gets(a);

length = strlen(a);

printf("the reversed string is:\n");

for( rotation=0; rotation<length; rotation++)

{

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

{

rotated_element_number[i] = i + rotation;

while(rotated_element_number[i] > (length-1)) rotated_element_number[i] -= length;

printf("%c", a[rotated_element_number[i]]);

}

printf("\t");

}

getchar();

return 0;

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program that give all the rotations of a string?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a program to implement domain and referential integrity?

give me the program which can related on domain and referential integrity.


When will be the BCA Ist year exam session 2009 of MU?

hello ...can u give me answer how to write program inheretance ... and types of inheretance ..... hello ...can u give me answer how to write program inheretance ... and types of inheretance .....


Write in BlueJ to print lucky numbers?

To print lucky numbers in java, you must give the following program: class example { static public void main(String[] args) { System.out.println("Lucky number is your favourite number which is your DOB"); } }


Can you give an example of array using character variable in c program?

the example of array over charcter variables is char ["string"]


When you give flumpy string and the glue where do you find the sticks super moshies?

Please re-write so adults can understand


Write a script that accepts two strings from the user and compare two strings in web technology?

how to compare two strings that take input from the user and compare it. For example: i give first string as "THE" and give second string as "HTE" then return "match" if i give first as"THE" nd second string as "EHI" then return "NOtMatch" witout using STRCMP ... please help me


Write a program to calculate the area of a cylinder using a function?

give an example of calculation of mathematics


Write a program in FORTRAN C language to compute control ratios used in budgeting with reference to any organization?

if u give control ratios used in budgeting i can write program in C/C++


Can you give me a program that will compute number 1 to 5?

nr\m;laeoh9y0m g.qthnedxc In fortran: do i=1,5 write(6,*)i enddo stop end This program will write the numbers 1 to 5 on the screen.


What is SAP give you the brief solution?

Write a program to convert a 2-digit BCD number into hexadecimal


What did crop rotations do?

crop rotations give the soil a break from having to support the same crop which drains the soil of the nutrients. Eventually the slil is deprived of the nutrient and the plant will no longer grow there.


Java program to give input of a string and display it?

import java.util.*; public class Example { public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.println("Please enter a string:"); String input = in.next(); System.out.println("The String you entered is: " + input); } }