Maha

Maha

  • NA
  • 0
  • 169.6k

Postfix

Nov 24 2011 6:55 PM
// This program tells the user the values of the integers that are
// one more and one less that the entered integer
using System;
public class DebugTwo4
{

public static void Main(string[] argus)
{
string entry;
int enteredInteger;
int more, less;

Console.Write("Enter an integer ");

entry = Console.ReadLine();

Console.WriteLine("You entered {0}", entry);

enteredInteger = Convert.ToInt32(entry);

more = ++enteredInteger;

less = enteredInteger--;

Console.WriteLine("One more than {0} is {1} and one less than {0} is {2}", entry, more, less);

Console.ReadKey();
}
}
/*10 is input then output is "One more than 10 is 11 and one less than 10 is 11" what should be done to get the output "One more than 10 is 11 and one less than 10 is 9. Any one knows please help me */

Answers (4)