#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;
}
Chat with our AI personalities
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"); } }
the example of array over charcter variables is char ["string"]
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); } }
i want to write a simple without using pointer or array c program which will print greatest number when i give 20 number .........How far have you gotten so far?
class firstprog { public static void main (String args[]) { System.out.pritnln("My first Program in Java "); } } Simple Java Programe Write the above program in Ms dos's edit or Notepad of Windows save it with "firstprog.java" run the commands given below in command prompt of Ms Dos to get the output Remamber Java is case sensative so mentain capital and small letter. 1. javac firstprog.java 2. java firstprog