text: Print squares of first n natural numbers without using * , / and | C # program to print squares of first ' n ' natural numbers without using * , / and - ; Initialize ' square ' and first odd number ; Calculate and print squares ; Print square ; Update ' square ' and ' odd ' ; Driver Code
code: using System ; class GFG { static void printSquares ( int n ) { int square = 0 , odd = 1 ; for ( int x = 0 ; x < n ; x ++ ) { Console . Write ( square + " ▁ " ) ; square = square + odd ; odd = odd + 2 ; } } public static void Main ( ) { int n = 5 ; printSquares ( n ) ; } }