Here is a C++ program to print perfect square number between 1 to n
SOURCE CODE OUTPUT
#include<iostream>
using namespace std;
int main()
{
int num;
cout<<"Enter the value ";
cin>>num;
for(int i=1;i*i<=num;i++)
cout<<i*i<<" ";
return 0;
}
Any questions regarding to program
please write in comments.
No comments:
Post a Comment