answersLogoWhite

0


Best Answer

public class StringLength

{

public static void main(String args[])

{

String firstString;

String secondString;

System.out.println("Please enter string (group of characters) ");

firstString=sc.nextString();

System.out.println("Please enter second string (group of characters) ");

secondString=sc.nextString();

if(firstString>secondString)

{

System.out.println(); //create blank line

System.out.println("First String is greater than the second string");

System.out.println();

}

else

{

System.out.println("Second string is greater than the first string");

System.out.println();

}

}//closes the main method

}//closes the class.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program that finds greater of two strings entered by user?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a c program to copy two strings using pointers?

nahi malum


Write a program in 'C' language to accept 6 strings as input and print them in lexicographic?

(ab)*b


How do you Write A program in c language for checking a diagonal matrix?

Write a program in c++ that take input in a integer matrix of size 4*4 and find out if the entered matrix is diagonal or not.


Write a javascript program out of three no which one s greater?

1 2 3


How do you write a C program to copy to strings using pointers?

mystrcpy (char* dest, char* src) { while ((*dest++ = *src++) != '\0); }


Write a program to enter a character and it will tell the character etered?

{char a;...cout > a;cout


Should i added strings to my composition?

Yes, but only if you actually know how to write for strings.


How do you write talking strings in Cherokee?

syllabry


Can program development be done by a program?

Yes and no, program development works in programming codes which are specifically made for humans to be entered, a program can write these programming codes too. The thing is, you would need to write the programming codes yourself before the program can use it in program development. If a program could invent the wheel, then you still need to invent that wheel before the program can. Or atleast until the thinking of the human brain can be translated into mere programming code.


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] ); }


Write a program to accept 2 numbers and tell whether the product of the two number is equal to or greater than 1000?

C programm


How do you write the greater sign in math?

This is greater > then this