Code for calculating
square root without
using library function,
of math.h
Answer Posted / manikant
#include<iostream.h>
void main()
{
int num,i;
cout<<"enter anumber:";
cin>>num;
for(i=2;i<num/2;i++)
{
if(num/i==i)
{
cout<<"\nsquareroot of "<<num<<"="<<i;
break;
}
else
continue;
}
if(num/i!=i)
cout<<"\nthis no is not a perfect square.";
}
| Is This Answer Correct ? | 16 Yes | 13 No |
Post New Answer View All Answers
Simplify the program segment if X = B then C ← true else C ← false
What are data structures in c and how to use them?
What is the difference between memcpy and memmove?
What is the difference between constant pointer and constant variable?
Is array a primitive data type in c?
find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2
What is a program flowchart and explain how does it help in writing a program?
Explain what is the stack?
Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.
Which driver is a pure java driver
what are enumerations in C
hi send me sample aptitude papers of cts?
What is n in c?
How is actual parameter different from the formal parameter?
Can the sizeof operator be used to tell the size of an array passed to a function?