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 math functions are available for integers? For floating point?
how should functions be apportioned among source files?
What are volatile variables in c?
Explain threaded binary trees?
Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?
can any one provide me the notes of data structure for ignou cs-62 paper
What is the advantage of a random access file?
What is getch?
Is c a great language, or what?
What does c mean before a date?
What is optimization in c?
What is a method in c?
Hi can anyone tell what is a start up code?
Is it valid to address one element beyond the end of an array?
Explain what does it mean when a pointer is used in an if statement?