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


Please Help Members By Posting Answers For Below Questions

What is file in c language?

782


Tell me is null always defined as 0(zero)?

845


What is pointers in c with example?

802


How pointers are declared?

734


Do you have any idea about the use of "auto" keyword?

870


What are c preprocessors?

923


write a program in c language to print your bio-data on the screen by using functions.

6539


What's the total generic pointer type?

834


Tell me can the size of an array be declared at runtime?

810


What are unions in c?

782


What is scanf_s in c?

852


What will the preprocessor do for a program?

788


What does the file stdio.h contain?

812


What is function pointer c?

796


Why pointers are used?

836