Jump to content

The Number War: Count to 100 or -100


RainDreamer

Recommended Posts

public static AppMain (string[] args)

{

int currentValue = Console.ReadLine();

// acquire value from previous line

int newValue = currentValue++;

// increment value

Console.Write(newValue);

// return value

}

That code reads a value from user input, adds 1, and returns the adjusted value.

The number is now 38.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...