#include<stdio.h>
#include<conio.h>
float SquareRoot(float num);
void main()
{
float input, ans;
clrscr();
printf("\n Enter The Number : ");
scanf("%f", &input);
ans = SquareRoot(input);
printf("\n Square Root : %f", ans);
getch();
}
float SquareRoot(float num)
{
if(num >= 0)
{
float x = num;
int i;
for(i = 0; i < 20; i ++)
{
x = (((x * x) + num) / (2 * x));
}
return x;
}
}
hey people anyone who came accross my work can now join us live at http://aethtech.com aetherius infosolutions pvt ltd is my new venture to provide high quality education for engineering/bca/mca or foreign internship students.
ReplyDeleteAetherius
Delete