example I enter 1357 and program out 106 instead of 10
string num = Console.ReadLine();
Console.Write(Convert.ToInt32(num[1]) + Convert.ToInt32(num[3]));
Console.ReadKey();
example I enter 1357 and program out 106 instead of 10
string num = Console.ReadLine();
Console.Write(Convert.ToInt32(num[1]) + Convert.ToInt32(num[3]));
Console.ReadKey();
First convert the single characters to a string before converting to integer. Convert will use the Unicode code point value when converting char to integer directly.
var value = Convert.ToInt32(num[1].ToString()) + Convert.ToInt32(num[3].ToString());