Python language format function in C #

1
int varvalor;
int var01 = varvalor * 1;
Console.Write("Digite um número para ser multiplicado: ");
var01 = Convert.ToInt32 (Console.ReadLine());
Console.WriteLine();

I wanted to write in Console.WriteLine(); these lines of code that is written in Python.

varvalor = int(input("Digite um número para ser multiplicado: "))
var01 = varvalor * 1
print("{} x 1 = {}".format(varvalor, var01))

Is there any way to do this in C #?

    
asked by anonymous 13.02.2018 / 00:39

1 answer

1

I see several problems in these codes, but to answer your question, you can do this:

$"{varvalor} x 1 = {var01}"

See more .

    
13.02.2018 / 00:48