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
What is the value of h?
Explain the difference between the local variable and global variable in c?
find out largest elemant of diagonalmatrix
Explain the difference between #include "..." And #include <...> In c?
C program to find all possible outcomes of a dice?
How can I write functions that take a variable number of arguments?
What are global variables and how do you declare them?
What is the heap in c?
What is the difference between NULL and NUL?
Why isnt any of this standardized in c?
What is the difference between the expression “++a” and “a++”?
Here is a good puzzle: how do you write a program which produces its own source code as output?
Is there a built-in function in C that can be used for sorting data?
Explain what is the difference between a string and an array?
How can you increase the size of a dynamically allocated array?