Tuesday, 31 December 2013

C++ Program To Print The Perfect Square Number Which is Less Than 1000

#include<iostream.h>
void main()
{
   clrscr();
   int n=1000, s=0;
   cout<<"The Squre values Which is less Than 1000 is::  " ;

   for(int i=1;s<n;i++)
    {
      s=i*i;
      if(s>n)
      break;

     cout<<s<<" ";

    }


       getch();

}

No comments:

Post a Comment