Code for calculating
square root without
using library function,
of math.h

Answer Posted / manikant

#include<iostream.h>
void main()
{
int num,i;
cout<<"enter anumber:";
cin>>num;
for(i=2;i<num/2;i++)
{
if(num/i==i)
{
cout<<"\nsquareroot of "<<num<<"="<<i;
break;
}
else
continue;

}
if(num/i!=i)
cout<<"\nthis no is not a perfect square.";
}

Is This Answer Correct ?    16 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When can a far pointer be used?

586


In which layer of the network datastructure format change is done

1428


What are loops in c?

546


Can static variables be declared in a header file?

612


how we can make 3d venturing graphics on outer interface

3998






What is ambagious result in C? explain with an example.

2052


What is a function simple definition?

610


Why doesnt that code work?

597


What are local static variables? How can you use them?

642


What is c token?

604


how do you execute a c program in unix.

636


What is sizeof c?

604


which is an algorithm for sorting in a growing Lexicographic order

1394


Explain what is #line used for?

603


What is the difference between #include

and #include “header file”?

545