Program to print non square numbers | CPP program to print first n non square number ; Returns n - th non - square number . ; loop to print non squares below n ; Driver code
#include <bits/stdc++.h> NEW_LINE int nonsquare ( int n ) { return n + ( int ) ( 0.5 + sqrt ( n ) ) ; } void printNonSquare ( int n ) { for ( int i = 1 ; i <= n ; i ++ ) printf ( " % d ▁ " , nonsquare ( i ) ) ; } int main ( ) { int n = 10 ; printNonSquare ( n ) ; return 0 ; }