Write a program to find the integer square root of a given number.That is the largest integer whose square is less than or equal to the given number.
Muhammad Arslan_1
0
Newbie Poster
Recommended Answers
Jump to PostOK, I've written it. If you let me have your teacher's email address I can submit it for you to save you the bother of copy/pasting it yourself.
DaniWeb Member Rules (which you agreed to when you signed up) include:
"Do provide evidence of having done some work yourself if …
Jump to PostUse the sqrt function from the cmath library. That gives you a double as an answer. Assign it to an integer variable.
int x = sqrt(24); // x = 4
All 5 Replies
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
Muhammad Arslan_1
0
Newbie Poster
AssertNull
1,094
Practically a Posting Shark
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
mabdullah4
-3
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.