Calculate the integer square root by calculating

Assignment Help C/C++ Programming
Reference no: EM13820279

Calculate the integer square root by calculating

Ask the user for a number between 2 and 1000. Calculate the integer square root by calculating the square of every number from 1 until the square of the number is more than the number entered. The previous number is the integer square root. For example, if the user enters 15, your program would calculate 1x1 = 1, 2x2 = 4, 3x3 = 9, 4x4 = 16 -- since 16 is too high, the integer square root of 15 is 3.

YOU MUST write a function called intSqrRoot which calculates the answer and returns it to main; call it as follows:

answer = intSqrRoot(num);

cout << "The integer square root of ";

cout << num;

cout << " is ";

cout << answer;

cout << ".";

cout << endl;

Reference no: EM13820279

Questions Cloud

Assignment on create an encoding scheme : Create an encoding scheme
Distinguish the role of the np in clinical trials : Compare and contrast nursing research to that of other fields of study - Appraise the role of the NP in the process of collaboration with researchers in other fields.
Write the statement about strategy and theories : Analyze the case what i post, and write the statement about strategy, theories, SWOT, environmental scan
What is the state of nature really like : What is the State of Nature really like? Present your own description, comparing/ contrasting it to some of Aristotle's, Hobbes', and Locke's ideas of the pre-political state.
Calculate the integer square root by calculating : Calculate the integer square root by calculating
How to improve online presence : Facebook evaluation elements include cover photo, profile picture, page title, likes, people talking about this, about and engagement. Using this information, you will then make recommendations to the CEO about how to improve online presence
Formulate and develop a thesis comparing two or more works : ENGL 102 Using guidelines from your textbook(e.g.'The Willing Mistress' by "Aphra Behn" and 'To his Coy Mistress' by "Andrew Marvell") Formulate and develop a thesis that compares two or more works from this class in depth. Your detailed analysis sho..
Examine potential challenges the np may encounter : Code of Ethics for Nurses, Encountering Challenging Dilemmas and Mentorship - Examine potential challenges the NP may encounter in practice and create potential solutions. Share this with your colleagues in your post and offer feedback as you read ..
Professional development and lifelong learning : NPs must invest in lifelong learning strategies for professional development, to maintain licensure and certification and for personal enrichment. Fortunately, numerous options and opportunities for lifelong learning and professional development e..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a program that asks user to enter

Write a program that asks user to enter the size of the matrix (rows and column) then, it asks the user to enter the elements of two matrices and finally it adds two matrix and displays the result in C language.

  Why is exception handling important to software development

Please respond to all of the following prompts: Why is exception handling important to software development? Can there be such a thing as too much exception handling? How does exception handling affect performance of code execution?

  Program that generates 50,000 random integers

Program that generates 50,000 random integers from 1 to 6 (inclusive). Count the number of times that each number occurs and output the totals

  A hierarchical jpeg encode decoder for greyscale images

This project is to develop a program that implements a hierarchical JPEG encoder/decoder for greyscale images.

  Write a recursive function that takes a string

Write a recursive function that takes a string as a parameter and prints its reversal in the same function in C++

  You are to create a program

You are to create a program that will input a group of floating point values, storing them as double values in an array. This array will then be sent to three functions.

  Child process to take the role of the number guesser

Write a program in C that takes a number between 1 and 1024 as input on the command line, and then forks a child process to take the role of the number guesser

  Checking for a palindrome

For this Programming Activity, you will write a GUI-based program checking for a Palindrome.Turn to Page 959 in your text.Complete Programming Activity 1: Checking for a Palindrome.

  Set up a user terminated loop

Write a program in c language that finds a maximum of three numbers. Input consists of the three numbers. Output should list the three numbers and display the largest of the three.

  Creates a macro to calculate the area

Build a program that creates a macro to calculate the area of a circle using the formula area = pie x radius x radius. In the same program, prompt the user to enter a circle's radius. Use the macro to calculate the circle's area and display the re..

  Static field holds total winnings for all horses in stable

static field holds total winnings for all horses in the stable // total winnings are shown after each horse wins,

  For the employee class make

For the Employee class make sure that no person is underage or too old (less than 16 or greater than 80). Do nothing for the set function if the person's age is out of range.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd