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
When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd
Explain the difference between ++u and u++?
What is d scanf?
What is the return type of sizeof?
What is difference between Structure and Unions?
program to find out date after adding 31 days to a date in the month of febraury also consider the leap year
Explain c preprocessor?
What is queue in c?
What is the value of h?
What is nested structure in c?
What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?
What is hash table in c?
When is a “switch” statement preferable over an “if” statement?
How can I split up a string into whitespace-separated fields?
Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)