Hi!
I want to know how to create a console application that when the user inputs the big number, the system will sum the 2nd, 4th, and 6th digits of that number and shows the result if the sum is 100> and <200 as Red. else 200< and >300 as blue.
Hi smcdevelopmen...,
Please refer below sample.
Code
public static void Main(string[] args) { char[] n = 93512563.ToString().ToCharArray(); Console.WriteLine(int.Parse(n[2].ToString()) + int.Parse(n[4].ToString()) + int.Parse(n[6].ToString())); Console.ReadKey(); }
Screenshot
© COPYRIGHT 2024 ASPSnippets.com ALL RIGHTS RESERVED.