using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SquareNumber
{
class Program
{
int n;
public void Square(int n)
{
Console.WriteLine(n);
n *= n;
Console.Write(n);
}
Program()//Constructor
{
n = 10;
Square(n);
}
static void Main(string[] args)
{
Program cal = new Program();
Console.ReadLine();
}
}
}
Output:-
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SquareNumber
{
class Program
{
int n;
public void Square(int n)
{
Console.WriteLine(n);
n *= n;
Console.Write(n);
}
Program()//Constructor
{
n = 10;
Square(n);
}
static void Main(string[] args)
{
Program cal = new Program();
Console.ReadLine();
}
}
}
Output:-
No comments:
Post a Comment