3
Answers

How Do I:compering without using any type of condition

safaa

safaa

14y
2.2k
1

Can I compere among three strings and find the greater among them and if there are indentical strings without using any kind of condition?and how can I do this?
Answers (3)
0
Amit Choudhary

Amit Choudhary

NA 27.7k 3m 14y

hi friend,
what is the meaning of greater here... is it related to string length or Dictionary order.
if it is length then you can calculate the length and use the to get the greatest other wise use CompareTo function to compare the strings according to dictionary order and it'll return you 1 if greater, -1 if smaller and 0 if equals.... use these values and find your greatest string.
Please mark as answer if it helps.
-1
Sam Hobbs

Sam Hobbs

NA 28.7k 1.3m 14y

Why do you need "to compere without any condition"? Is this a class assignment?
 
What function does "output of the function is 0,1 or -1" describe? Is that a function that has already been written that you need to use or is it a function you need to write or something else?
-1
safaa

safaa

NA 3 0 14y

hi Amit
if I use the compere I need condition to determind wether the output of the function is 0,1 or -1 and I want to compere without any condition in my program
thanks
SAFFY