using System; namespace C_Sharp_Console { /// /// Summary description for Class1. /// using System; using System.Collections; // needed for ArrayList using System.IO ; // needed for file IO public class Class1 { /// /// The main entry point for the application. /// static void Main() { Class1 c = new Class1(); int x = 1 ; int y = -2 ; int z = 4 ; int m = c.sum(3,1,4,1,5,9) ; int n = c.sum(x,y,z) ; Console.WriteLine("m={0}, n={1}",m,n) ; ArrayList name = new ArrayList(); name.Add("Gizmo"); name.Add(75); for(int i=0; i0) { Console.WriteLine("n={0}",n) ; n-- ; } do { Console.WriteLine("n={0}",n) ; n++ ; } while(n<5) ; StreamWriter outstr = new StreamWriter("testout_JP.txt") ; outstr.WriteLine("Dis here test.") ; outstr.Close() ; StreamReader instr = new StreamReader("testout_JP.txt") ; string s = instr.ReadToEnd() ; Console.WriteLine("File says: {0}", s) ; } public int sum(params int[] vals) { int temp=0 ; foreach(int n in vals) temp += n ; return temp ; } } }