Как вывести полученное число в перевернутом виде? - C#
Формулировка задачи:
int a, b, c, d;
Console.WriteLine("введите 3 числа");
Console.Write("a= ");
a = Convert.ToInt32 (Console.ReadLine());
Console.Write("b= ");
b = Convert.ToInt32 (Console.ReadLine());
Console.Write("c= ");
c = Convert.ToInt32 (Console.ReadLine());
{ d = a * b * c; }
Console.WriteLine(d);
Console.ReadLine();Решение задачи: «Как вывести полученное число в перевернутом виде?»
textual
Листинг программы
using System;
using System.Linq;
namespace ConsoleApp27
{
class Program
{
public static void Main()
{
int a, b, c, d;
Console.WriteLine("введите 3 числа");
Console.Write("a= ");
a = Convert.ToInt32(Console.ReadLine());
Console.Write("b= ");
b = Convert.ToInt32(Console.ReadLine());
Console.Write("c= ");
c = Convert.ToInt32(Console.ReadLine());
d = a * b * c;
Console.WriteLine(d);
Console.WriteLine(d.ToString().Reverse().ToArray());
Console.ReadLine();
}
}
}