The question is:
Write a program that:
a. Find the smallest integer n such that n2 is greater than 12,000.
b. Find the largest integer n such that n3 is less than 12,000.
The program compiles and runs, but the program just keeps running and wont output or give me any numbers. what do i need to do to fix this? I am new to programming so please keep it as simple as possible
Write a program that:
a. Find the smallest integer n such that n2 is greater than 12,000.
b. Find the largest integer n such that n3 is less than 12,000.
#include<iostream>
using namespace std;
int main(){
int smallnumber=0;
int largenumber=50;
while (smallnumber*smallnumber<=12000){
smallnumber++;
}
while (largenumber*largenumber*largenumber>=12000){
largenumber--;
}
return 0;
}
The program compiles and runs, but the program just keeps running and wont output or give me any numbers. what do i need to do to fix this? I am new to programming so please keep it as simple as possible