Code for calculating
square root without
using library function,
of math.h
Answer Posted / abhinav dwivedi
#include<stdio.h>
#include<conio.h>
void main()
{
int num,i;
clrscr();
printf("enter no to find square root");
scanf("%d",&num);
for(i=1;i<=num/2;i++)
{
if(num/i==i && num%i==0)
{
printf("square root of entered no is %d",i);
break;
}
else
{
continue;
}
}
if(num/i!=i)
printf("their is no perfect suare root of entered no");
}
| Is This Answer Correct ? | 10 Yes | 9 No |
Post New Answer View All Answers
Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?
What is difference between structure and union with example?
if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0
How many header files are in c?
Why is sizeof () an operator and not a function?
What is zero based addressing?
Why calloc is better than malloc?
hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .
Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)
What is the Purpose of 'extern' keyword in a function declaration?
Is fortran still used in 2018?
What is meant by keywords in c?
How can I swap two values without using a temporary?
Can we assign integer value to char in c?
What is the use of bit field?