Gajendra Jangid
How To Get Largest Number from numbers without using of list or array?
By Gajendra Jangid in C# on Jan 22 2018
  • Ayappan Alagesan
    Feb, 2018 6

    Where to store the number without using any collection like list or array or dictionary or hashtable and ect..?

    • 2
  • ZeroWave Producer
    Sep, 2019 17

    These “numbers” have to be stored in some sort of array or list.

    For all comments the String type itself is an array of chars.

    • 1
  • Naresh Tottempudi
    Mar, 2018 1

    string s = "1234";int temp = 0;for (int i = 0; i <= s.Length - 1; i++){for (int j = 0; j <= s.Length - 1; j++){if (s[i] > s[j]){temp = s[i];}}}Console.Write(Convert.ToChar(temp));

    • 1
  • Gajendra Jangid
    Feb, 2018 6

    you can use substring and loop to find number

    • 1
  • Gajendra Jangid
    Jan, 2018 22

    string a = "517378";int max = 0;while (a.ToString().Length > 1){max = Convert.ToInt32(a.Substring(0, 1));a = a.Substring(1, a.ToString().Length - 1);if (max > Convert.ToInt32(a.Substring(0, 1))){a = a.Remove(0, 1).Insert(0, max.ToString());}}MessageBox.Show("Second Max Num is : "+max.ToString());

    • 1


Most Popular Job Functions


MOST LIKED QUESTIONS