namespace Prime2
{
class SumOfEvenAndOddDigits
{
public static void ConvertToArrayOfDigits(int value, int[] digits)
{ for (int index = digits.Length - 1; index >= 0; index--)
{ digits[index] = value % 10;
value = value / 10;
} }
static void Main(string[] args)
{
double number,num1,res,rem;
//string number;
double temp = 0;
//double ar[15];
Console.WriteLine("Enter any Number");
number = double.Parse (Console.ReadLine());
num1 = number;
while (number>0)
{
res = number % 10;
temp = temp + res;
number = number % 100;
}
Console.WriteLine("Even Digit Sum is " + temp);
while (num1>0)
{
rem = num1 % 10;
rem = rem / 10;
temp = temp + rem;
num1 = num1 / 100;
}
Console.WriteLine("Odd Digit Sum is " + temp);
}
}
}