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 is file in c language?
Tell me is null always defined as 0(zero)?
What is pointers in c with example?
How pointers are declared?
Do you have any idea about the use of "auto" keyword?
What are c preprocessors?
write a program in c language to print your bio-data on the screen by using functions.
What's the total generic pointer type?
Tell me can the size of an array be declared at runtime?
What are unions in c?
What is scanf_s in c?
What will the preprocessor do for a program?
What does the file stdio.h contain?
What is function pointer c?
Why pointers are used?