Code for calculating
square root without
using library function,
of math.h
Answer Posted / sarath
#include<stdio.h>
#include<conio.h>
void main()
{
float i,num;
printf( "Enter number : ");
scanf("%f",&num);
for(i=2.0;i<num/2;i++)
{
if(num/i==i)
{
printf(" \nSquare root of %.0f = %.0f",num,i);
break;
}
else
continue;
}
if(num/i!=i)
printf("\nThere is no perfect integer square root for the number %.0f",num);
getch();
}
| Is This Answer Correct ? | 34 Yes | 17 No |
Post New Answer View All Answers
What are the __date__ and __time__ preprocessor commands?
Is it valid to address one element beyond the end of an array?
What is dynamic memory allocation?
Ow can I insert or delete a line (or record) in the middle of a file?
Explain what is the heap?
Explain what will be the outcome of the following conditional statement if the value of variable s is 10?
what is event driven software and what is procedural driven software?
What is a structural principle?
What is the purpose of the statement: strcat (S2, S1)?
How can I get random integers in a certain range?
What is the use of function in c?
What are the uses of a pointer?
Calculate the weighted average of a list of n numbers using the formula xavg = f1x1+f2x2+ ….+ fnxn where the f’s are fractional weighting factors, i.e., 0<=fi<1, and f1+f2+….+fn = 1
Is javascript based on c?
Explain setjmp()?