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
Why is it that not all header files are declared in every C program?
What is the process to generate random numbers in c programming language?
What are the different types of control structures?
What is masking?
When do we get logical errors?
What is zero based addressing?
What is #include stdio h?
Explain what is a const pointer?
Explain what is the benefit of using an enum rather than a #define constant?
What is signed and unsigned?
Explain how can I make sure that my program is the only one accessing a file?
In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping
How can I get back to the interactive keyboard if stdin is redirected?
What math functions are available for integers? For floating point?
Explain how can I right-justify a string?