debugging help

Archived from the original Sajha.com — preserved as posted, replies can no longer be added here.
Start a New Discussion
Archived Post

mera pyara sathi bhai haru garo paryoo debug nai bhayee na .. lau na help chaiyoo monday samma bujaunu parney. // 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 System.Collections.Generic; using System.Linq; using System.Text; public class DebugThree2 { public static void Main(string[] args) { int num1, num2, num3; string snum1, snum2, snum3; Console.WriteLine("Enter first number "); num1 = Console.ReadLine(); snum1 = Convert.ToInt32(snum1); Console.WriteLine("Enter second number "); snum2 = Console.ReadLine(); num2 = Convert.ToInt32(snum2); Console.WriteLine("Enter third number "); snum3 = Console.ReadLine(); num3 = Convert.ToInt32(snum3); if(num1 <= num2 || num2 <= num3) Console.WriteLine("Numbers are in sequential order"); else if(num1 >= num2){ Console.WriteLine("Numbers are in reverse order"); else{ Console.WriteLine("Numbers are in neither sequential nor reverse order"); } }

ghumrey · Oct 10, 2009 11:52 PM · 11,552 views

1 Reply

Sorry dude, I didn't check earlier but just in case you still need it, I have posted it below. You were missing two braces -- that was all. // 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 System.Collections.Generic; using System.Linq; using System.Text; public class DebugThree2 {     public static void Main(string[] args)     {         int num1, num2, num3;         string snum1, snum2, snum3;         Console.WriteLine("Enter first number ");         num1 = Console.ReadLine();         snum1 = Convert.ToInt32(snum1);         Console.WriteLine("Enter second number ");         snum2 = Console.ReadLine();         num2 = Convert.ToInt32(snum2);         Console.WriteLine("Enter third number ");         snum3 = Console.ReadLine();         num3 = Convert.ToInt32(snum3);         if(num1 <= num2 || num2 <= num3)             Console.WriteLine("Numbers are in sequential order");         else if(num1 >= num2)         {             Console.WriteLine("Numbers are in reverse order");         }         else         {             Console.WriteLine("Numbers are in neither sequential nor reverse order");         }     } }

garbagegigo · Oct 17, 2009 9:27 AM

This conversation is preserved exactly as it was on the original Sajha.com and can't accept new replies.

Start a New Discussion

You might be interested in...

Recent Classifieds View all
Upcoming Events View all
Service Providers View all