|
Post by Admin on Jun 5, 2014 19:43:28 GMT -5
using System; class Program { public static void Main() { Program p = new Program(); p.EvenNumbers(); }
public void EvenNumbers() { int Start = 0;
while (Start <= 0) { Console.WriteLine(Start); Start = Start + 2; } } }
OR:
using System; class Program { public static void Main() { Program.EvenNumbers(30); }
public static void EvenNumbers(int Target) // Add static { int Start = 0;
while (Start <= Target) { Console.WriteLine(Start); Start = Start + 2; } } }
using System; class Program { public static void Main() { Program.EvenNumbers(30);
Program P = new Program(); int Sum = P.Add(10, 20);
Console.WriteLine("Sum = {0}, Sum); }
public static Add(int FN, int SN) { return FN + SN; }
public static void EvenNumbers(int Target) // Add static { int Start = 0;
while (Start <= Target) { Console.WriteLine(Start); Start = Start + 2; } } }
|
|