Click here to Skip to main content
15,913,669 members
Home / Discussions / C#
   

C#

 
AnswerRe: Data Base Pin
Abhijit Jana17-Oct-07 4:46
professionalAbhijit Jana17-Oct-07 4:46 
Questionconnecting to a remote printer, Pin
Rajeswari Tholeti17-Oct-07 2:34
Rajeswari Tholeti17-Oct-07 2:34 
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 
hi,
i am trying to check how exactly the return statement woorks,for that i wrote a code......
my logic is like this....
result will be having a value which will be assigned to sum via return....
and in function(method) it should add the value of sum with one....
for example

x=5
y=5
so sum = 10
in method a it should give me 11.....
am a beginner....

the result rite now i am getting is 10 and 0
is my logic correct if not wer am i going wrong?????


using System;
using System.Collections.Generic;
using System.Text;

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

public static 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 static void a()
{
int a;
a = sum + 1;
Console.WriteLine("the value of {0} ",a);
}


static void Main(string[] args)
{
read();
int sum = Add();
Console.WriteLine("the value of result is {0}",result);
a();
Console.ReadLine();
}
}
}

thanks in advance


j
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 
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 

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.