The file DebugFour2.cs has syntax and/or logical errors. Determine the problem(s), and fix the program.   // Program asks user to enter three integers // Program displays a message indicating whether the numbers // are in sequential order, // in reverse order // or in neither order using System; using static System.Console; class DebugFour2 {    static void Main()    {       int num1, num2, num3       string snum1, snum2, snum3;       WriteLine("Enter first number ");       snum1 = ReadLine();       num1 = Convert.ToInt32(snum1);       WriteLine("Enter second number ");       snum2 = ReadLine();       num2 = Convert.ToInt32(snum2);       WriteLine("Enter third number ");       snum3 = ReadLine();       num3 = Convert.ToInt32(snum3);       if(num1 > num2 && num2 <= num3)          WriteLine("Numbers are in sequential order");       else          if(num1 < num2 && num2 == num3)             WriteLine("Numbers are in reverse order");          else             WriteLine("Numbers are in neither sequential nor reverse order");    } }

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter8: Advanced Method Concepts
Section: Chapter Questions
Problem 8RQ
icon
Related questions
Question
100%

The file DebugFour2.cs has syntax and/or logical errors. Determine the problem(s), and fix the program.

 

// Program asks user to enter three integers
// Program displays a message indicating whether the numbers
// are in sequential order,
// in reverse order
// or in neither order
using System;
using static System.Console;
class DebugFour2
{
   static void Main()
   {
      int num1, num2, num3
      string snum1, snum2, snum3;
      WriteLine("Enter first number ");
      snum1 = ReadLine();
      num1 = Convert.ToInt32(snum1);
      WriteLine("Enter second number ");
      snum2 = ReadLine();
      num2 = Convert.ToInt32(snum2);
      WriteLine("Enter third number ");
      snum3 = ReadLine();
      num3 = Convert.ToInt32(snum3);
      if(num1 > num2 && num2 <= num3)
         WriteLine("Numbers are in sequential order");
      else
         if(num1 < num2 && num2 == num3)
            WriteLine("Numbers are in reverse order");
         else
            WriteLine("Numbers are in neither sequential nor reverse order");
   }
}
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,