answersLogoWhite

0


Best Answer

class BackString

{

public static void main(String[] args)

{

//work out the length of args[]

int len=args.length;

//cycle forwards through the array string

for (int i=0; i<len; i++)

{

//how long is the word in characters?

int wordLen = args[i].length();

//cycle backwards through the word a char at a time

for (int j=wordLen-1; j>=0; j--)

{

System.out.print(args[i].charAt(j));

}

System.out.print(" ");

}

}

}

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program take three strings from the command line and display the number of characters in each string in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Write a C program to accept a string from user and display its ascii value and then display sum of all ascii value of strings?

//C program to accept a string from user and //display its ascii value and //then display sum of all ascii value of strings #include&lt;stdio.h&gt; #include &lt;string.h&gt; int main() { char String[100]; int Sum,Index; Sum=0; //Sum is initially zero printf("Enter the string:\n"); gets(String); //Accept String from User for(Index=0;Index&lt;strlen(String);Index++) { Sum+=(String[Index]); //Adds (the ASCII values of) the String characters. } printf("The sum is %d\n",Sum); //Printing it as %d gives the equivalent ASCII value. return 0; }


Write javascript code to display a list of strings?

You need to put the strings in an array, and then loop through the array to output the strings. Something like this would be a simple example: ---------------- var strings = ["s1","s2","s3"]; for ( var i in strings ) { document.write( strings[i] ); }


What is the difference between strings and lists in Python?

They have different methods, and they display differently when printed.


What purpose do strings serve in programming?

Strings are a type of variable in computer programming. Simply put, they contain multiple characters which are "strung" together to make a piece of text. "Test", "House", and "Hello World!" are all excellent examples of what might be contained in a string. As a result, strings are used to store and convey any textual information.


C plus plus program that display student name course and grade using arrays of strings?

enum field { name, course, grade }; std::string student[3]; student[name] = "Joe Bloggs"; student[course] = "C++ Programming"; student[grade] = "A+";

Related questions

Write a C program to accept a string from user and display its ascii value and then display sum of all ascii value of strings?

//C program to accept a string from user and //display its ascii value and //then display sum of all ascii value of strings #include&lt;stdio.h&gt; #include &lt;string.h&gt; int main() { char String[100]; int Sum,Index; Sum=0; //Sum is initially zero printf("Enter the string:\n"); gets(String); //Accept String from User for(Index=0;Index&lt;strlen(String);Index++) { Sum+=(String[Index]); //Adds (the ASCII values of) the String characters. } printf("The sum is %d\n",Sum); //Printing it as %d gives the equivalent ASCII value. return 0; }


Write javascript code to display a list of strings?

You need to put the strings in an array, and then loop through the array to output the strings. Something like this would be a simple example: ---------------- var strings = ["s1","s2","s3"]; for ( var i in strings ) { document.write( strings[i] ); }


How do you display strings?

C: puts, printf, fputs, fprintf, write, fwrite...


How do you create program using characters strings in turbo c?

#include int main (int argc, char **argv){printf ("The name of this program is %s\n", argv[0]);return 0;}There's two character-string in this program, a literal and a variable. Go find them.


What is the difference between strings and lists in Python?

They have different methods, and they display differently when printed.


What is string args?

String[] args means an array of sequence of characters (Strings) that are passed to the &quot;main&quot; function. This happens when a program is executed. Example when you execute a Java program via the command line: java MyProgram This is just a test. Therefore, the array will store: [&quot;This&quot;, &quot;is&quot;, &quot;just&quot;, &quot;a&quot;, &quot;test&quot;] To learn more about data science please visit- Learnbay.co


How can you do the same thing as the program below but using strings and arrays in C language?

Program below?!


How many strings of five ASCII characters contain the character at least once?

the total 128 ^5 the strings without @ at all 127^5 to get the strings that has at least @ once 128^5 - 127^5


What is use of printf?

printf() is a build-in function under the header file 'stdio.h' in a C programming language. In c++,the same function is accomplished by 'cout' . It is used to display strings enclosed between double quotes. Its syntax is printf("...string/sentences/characters...."); After execution,all the characters between the double quotes will be displayed on the output screen.


What are strings in C?

an array of characters, usually terminated by a binary zero (0x00 or \0, not '0')


What are letters and characters converted to when entered into a computer?

Letters and characters are ultimately converted into strings of 1's and 0's or On's and Off's of electricity.


What purpose do strings serve in programming?

Strings are a type of variable in computer programming. Simply put, they contain multiple characters which are "strung" together to make a piece of text. "Test", "House", and "Hello World!" are all excellent examples of what might be contained in a string. As a result, strings are used to store and convey any textual information.