Click here to Skip to main content
16,007,111 members
Home / Discussions / C#
   

C#

 
AnswerRe: connecting to a remote printer, Pin
Abhijit Jana17-Oct-07 5:10
professionalAbhijit Jana17-Oct-07 5:10 
GeneralRe: connecting to a remote printer, Pin
Rajeswari Tholeti18-Oct-07 19:22
Rajeswari Tholeti18-Oct-07 19:22 
QuestionSystem.Runtime.InteropServices.COMException While Implementing Active Directory Pin
ap_pandey17-Oct-07 2:23
ap_pandey17-Oct-07 2:23 
AnswerRe: System.Runtime.InteropServices.COMException While Implementing Active Directory Pin
leppie17-Oct-07 3:08
leppie17-Oct-07 3:08 
QuestionRecieving MouseEvents Raised in Child by Parent Pin
Sukhjinder_K17-Oct-07 2:03
Sukhjinder_K17-Oct-07 2:03 
Questionreturn Pin
Trustapple17-Oct-07 1:37
Trustapple17-Oct-07 1:37 
AnswerRe: return Pin
Christian Graus17-Oct-07 1:49
protectorChristian Graus17-Oct-07 1:49 
AnswerRe: return Pin
Pete O'Hanlon17-Oct-07 1:55
mvePete O'Hanlon17-Oct-07 1:55 
I really don't know where to begin. There are so many things wrong with this code.
using System;
using System.Collections.Generic;
using System.Text;

namespace Returnmine
{
  class Program
  { 
    private int x,y;
    public int Add()
    {
      int result = x + y;
      return result;
    }

    public void read()
    {
      Console.WriteLine("the value of x is ");
      x = Int32.Parse(Console.ReadLine());
      Console.WriteLine("the value of y is ");
      y = Int32.Parse(Console.ReadLine());
    }
    public void a(int sum)
    {
      int outputValue;
      outputValue = sum + 1;
      Console.WriteLine("the value of {0} ",outputValue);
    }

    static void Main(string[] args)
    {
      Program p = new Program();
      p.read();
      int sum = p.Add();
      Console.WriteLine("the value of result is {0}",result);
      p.a(sum);
      Console.ReadLine();
    }
  }
}
While this code isn't perfect, it is better than the original. Compare the changes to see what I've done differently.

Deja View - the feeling that you've seen this post before.

GeneralRe: return Pin
Trustapple17-Oct-07 2:32
Trustapple17-Oct-07 2:32 
AnswerRe: return Pin
Matthew Cuba17-Oct-07 1:56
Matthew Cuba17-Oct-07 1:56 
AnswerRe: return Pin
J4amieC17-Oct-07 1:59
J4amieC17-Oct-07 1:59 
AnswerRe: return Pin
Luc Pattyn17-Oct-07 2:01
sitebuilderLuc Pattyn17-Oct-07 2:01 
GeneralRe: return Pin
Trustapple17-Oct-07 2:08
Trustapple17-Oct-07 2:08 
GeneralRe: return Pin
Luc Pattyn17-Oct-07 3:03
sitebuilderLuc Pattyn17-Oct-07 3:03 
GeneralRe: return Pin
Colin Angus Mackay17-Oct-07 3:16
Colin Angus Mackay17-Oct-07 3:16 
GeneralRe: return Pin
Trustapple17-Oct-07 18:40
Trustapple17-Oct-07 18:40 
QuestionDrawing border to items of listview Pin
anu8117-Oct-07 0:46
anu8117-Oct-07 0:46 
AnswerRe: Drawing border to items of listview Pin
Giorgi Dalakishvili17-Oct-07 1:25
mentorGiorgi Dalakishvili17-Oct-07 1:25 
GeneralRe: Drawing border to items of listview Pin
anu8117-Oct-07 2:49
anu8117-Oct-07 2:49 
GeneralRe: Drawing border to items of listview Pin
Giorgi Dalakishvili17-Oct-07 2:55
mentorGiorgi Dalakishvili17-Oct-07 2:55 
GeneralRe: Drawing border to items of listview Pin
anu8117-Oct-07 20:50
anu8117-Oct-07 20:50 
GeneralRe: Drawing border to items of listview Pin
Giorgi Dalakishvili17-Oct-07 20:59
mentorGiorgi Dalakishvili17-Oct-07 20:59 
General[Solved] : Drawing border to items of listview Pin
anu8117-Oct-07 21:35
anu8117-Oct-07 21:35 
GeneralRe: [Solved] : Drawing border to items of listview Pin
Giorgi Dalakishvili18-Oct-07 1:52
mentorGiorgi Dalakishvili18-Oct-07 1:52 
QuestionxmlScormStudio Pin
Silly Boy17-Oct-07 0:18
Silly Boy17-Oct-07 0:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.