The repository contains a collection of different programming snippets to different programming languages from own developments as well as other projects
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
programming-examples/c-sharp/Functions/C# Program to Demonstrate P...

25 lines
611 B

/*
* C# Program to Demonstrate Pass by Value Parameter
*/
using System;
class program
{
static void Cube(int x)
{
x = x * x * x;
Console.WriteLine("Value Within the Cube method : {0}", x);
}
static void Main()
{
int num = 5;
Console.WriteLine("Value Before the Method is called : {0}", num);
Cube(num);
Console.WriteLine("Value After the Method is called : {0}", num);
Console.ReadKey();
}
}
/*
Value Before the Method is called : 5
Value Within the Cube method : 125
Value After the Method is called : 5