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 are structure members?
When should volatile modifier be used?
Why c is called a middle level language?
What is an array in c?
How do I determine whether a character is numeric, alphabetic, and so on?
What is a good data structure to use for storing lines of text?
Why do we use header files in c?
Why is void main used?
a program that performs some preliminary processing in C, it acts upon certain directives that will affect how the compiler does its work a) compiler b) loader c) directive d) preprocessor
What is meant by gets in c?
What does the function toupper() do?
Write a program to check palindrome number in c programming?
a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode
What is the difference between void main and main in c?
Which is best linux os?