what is wrong with my code?

using System;

namespace FavoriteNumber
{
class Program
{
static void Main(string[] args)
{

Console.Write("Enter your favorite number!: ");
int faveNumber = Console.ReadLine()
int number = Convert.ToInt32("string value")
will give 30 points to who ever is right

Respuesta :

tonb

Answer:

namespace FavoriteNumber

{

   class Program

   {

       static void Main(string[] args)

       {

           Console.Write("Enter your favorite number!: ");

           string faveNumber = Console.ReadLine();

           int number = Convert.ToInt32(faveNumber);

           Console.Write($"Your favorite number seems to be {number}");

       }

   }

}

Explanation:

You were close. Spot the differences. A statement should end with a semicolon. Console.ReadLine() returns a string. That string is the input of what you want to convert to an int.

And of course you need to match each opening brace { with a closing brace }.