This is a C++ program. I have no idea where to start this one. Heres the problem
ID: 3610979 • Letter: T
Question
This is a C++ program. I have no idea where to start this one. Heres the problem: Read a number and repeatedly divide it in half until thequotient is less than 0.001. Print the result of each division. If you get in an infinite loop, hit CTRL C thx for helping and will rate!! This is a C++ program. I have no idea where to start this one. Heres the problem: Read a number and repeatedly divide it in half until thequotient is less than 0.001. Print the result of each division. If you get in an infinite loop, hit CTRL C thx for helping and will rate!!Explanation / Answer
//numbers.cpp : main project file.
#include "stdafx.h"
#include <iostream>
using namespace std;
int main(array<System::String ^>^args)
{
int number; //the number tobe divided
cout << "enter the number:";//printstatement
cin >> number;//read in
cout << "you have entered:" << number <<" ";//verification
double divide =0.001;//are argument
while(number >=divide){//argument passed to while loop
int result = number/2;//divide by half
number = result;//reassign
cout << "the results are asfollow:" << result<< " " ;//print results
}
return 0;//no clue whatthe return 0 is for
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.