Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to use multiple methods in C#?
#5
Marksman Bryan Wrote:I may be completely wrong because it is C#, but in java, you'd have to pass x and y in as parameters.
Code:
//in main, below taking inputs
Console.WriteLine(add(x,y));


//add method
public static int add(int num1, int num2){
return num1+num2;
}

Alright, I'll look that up and give it a try. Thank you for the response.
Reply


Messages In This Thread
How to use multiple methods in C#? - by kimicatdemon - 2012-03-31, 10:08 PM
How to use multiple methods in C#? - by Eos - 2012-03-31, 11:36 PM
How to use multiple methods in C#? - by Eos - 2012-04-01, 12:33 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)