How to print the squares of 1st 10 numbers?

Posted by Ddd under LINQ category on | Points: 40 | Views : 1395
using System;
using System.Linq;
class sqr
static void Main()
var a=Enumerable.Range(1,10);
var b=from p in a select p*p;
Console.WriteLine("the squares are");
foreach(var z in b)

Comments or Responses

Login to post response