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
Write a program to print “hello world” without using semicolon?
The purpose of this exercise is to benchmark file writing and reading speed. This exercise is divided into two parts. a). Write a file character by character such that the total file size becomes approximately >10K. After writing close the file handler, open a new stream and read the file character by character. Record both times. Execute this exercise at least 4 times b). Create a buffer capable of storing 100 characters. Now after generating the characters, first store them in the buffer. Once the buffer is filled up, store all the elements in the file. Repeat the process until the total file size becomes approximately >10K.While reading read a while line, store it in buffer and once buffer gets filled up, display the whole buffer. Repeat the exercise at least 4 times with different size of buffer (50, 100, 150 …). Records the times. c). Do an analysis of the differences in times and submit it in class.
What are the types of bitwise operator?
Explain what are binary trees?
How would you obtain the current time and difference between two times?
What is call by value in c?
which is an algorithm for sorting in a growing Lexicographic order
What does d mean?
Describe explain how arrays can be passed to a user defined function
How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?
Why should I prototype a function?
I have seen function declarations that look like this
What is the use of linkage in c language?
What does main () mean in c?
Why header file is used in c?