468,133 Members | 1,337 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,133 developers. It's quick & easy.

find error in below program

Expand|Select|Wrap|Line Numbers
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace condition_pgm
  7. {
  8.  
  9.     class evenodd
  10.     {
  11.         int num;
  12.  
  13.         public void accept()
  14.         {
  15.             Console.WriteLine("Enter number");
  16.             num = Convert.ToInt32(Console.ReadLine());
  17.  
  18.         }
  19.         public void check()
  20.         {
  21.             if (num % 2 = 0)
  22.             {
  23.                 Console.WriteLine("No is even");
  24.             }
  25.             else
  26.             {
  27.                 Console.WriteLine("No is odd");
  28.             }
  29.         }
  30.  
  31.     }
  32.  
  33.  
  34.     class Program
  35.     {
  36.         static void Main(string[] args)
  37.         {
  38.             evenodd a = new evenodd();
  39.             a.accept();
  40.             a.check();
  41.         }
  42.     }
  43. }
Mar 29 '10 #1
1 1076
tlhintoq
3,525 Expert 2GB
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.
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.
Mar 29 '10 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Peter Hansen | last post: by
19 posts views Thread by ashmangat | last post: by
26 posts views Thread by ak | last post: by
3 posts views Thread by Amritha.Datta | last post: by
2 posts views Thread by Olumide | last post: by
1 post views Thread by gcdp | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.