Wednesday 11 April 2012

41).Write a Program To Print The Perfect Square Number Which is Less Than 1000.

#include<conio.h>
#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

Write a program which reads a set of integers into an integer array and then prints "YES"if all of them are same otherwise print "NO".

#include<stdio.h> int main() { int a[10],M=0,i,n; printf("enter a value for n\n"); scanf("%d",&n); fo...