find error in below program

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rashmi55
    New Member
    • Mar 2010
    • 3

    find error in below program

    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    namespace condition_pgm
    {
    
        class evenodd
        {
            int num;
    
            public void accept()
            {
                Console.WriteLine("Enter number");
                num = Convert.ToInt32(Console.ReadLine());
                
            }
            public void check()
            {
                if (num % 2 = 0)
                {
                    Console.WriteLine("No is even");
                }
                else
                {
                    Console.WriteLine("No is odd");
                }
            }
    
        }
    
    
        class Program
        {
            static void Main(string[] args)
            {
                evenodd a = new evenodd();
                a.accept();
                a.check();
            }
        }
    }
    Last edited by tlhintoq; Mar 29 '10, 04:54 AM. Reason: [CODE] ...Your code goes between code tags [/CODE]
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    1. You will use code tags when using this forum. It is part of the posting guidelines.
    TIP: When you are writing your question, there is a button on the tool bar that wraps the [code] tags around your copy/pasted code. It helps a bunch. Its the button with a '#' on it. More on tags. They're cool. Check'em out.


    2. You will *NOT* issue orders to the volunteers here.
    Originally posted by Rashmi
    find error in below program
    There is no question here. There is no politeness, curtesous... not so much as a "please" or "Can you help me find the problem" Just a short blunt order: Find the error.

    This site is not where you get your homework done for you. It is not where others do your work for you. It is not a group of people who follow your commands.

    You couldn't bother to describe the purpose of the program... the *expected* results... the *actual* results... Or how the actual results were in some way wrong from the expected results. You couldn't bother describing any error messages (exceptions) that were raised in Visual Studio. You just ordered people to take your code, create a project and debug your mess for you.

    Well let me tell you right now: It doesn't work like that. Do it again and you will be banned.

    Please visit the Posting Guidelines for tips on how to ask questions to get the best help.

    Comment

    Working...