![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 20.08.2021 05:20 hanjonez
Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in binary. For an integer x, the algorithm is:
As long as x is greater than 0
Output x % 2 (remainder is either 0 or 1)
x = x / 2
Note: The above algorithm outputs the 0's and 1's in reverse order.
Ex: If the input is:
6
the output is:
011
#include
using namespace std;
int main() {
/* Type your code here. */
return 0;
}
![ansver](/tpl/images/cats/User.png)
Answers: 1
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 17:30
Where would you click to edit the chart data?
Answers: 1
![question](/tpl/images/cats/informatica.png)
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 23:40
4. what is the reason for including the following code snippet in the header file animal.h? #ifndef animal_h #define animal_h class animal { public: animal(); animal(double new_area_hunt); void birth(); void hunt(double new_area_hunt); void death(); double get_area_hunt() const; private: double area_hunt; }; #endif
Answers: 3
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 06:30
Ineed to know the anwser to all these questions
Answers: 2
You know the right answer?
Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's repre...
Questions
![question](/tpl/images/cats/fizika.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 09.02.2021 05:40
![question](/tpl/images/cats/mat.png)
Mathematics, 09.02.2021 05:40
![question](/tpl/images/cats/istoriya.png)
History, 09.02.2021 05:40
![question](/tpl/images/cats/obshestvoznanie.png)
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/istoriya.png)
History, 09.02.2021 05:40
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 09.02.2021 05:40
![question](/tpl/images/cats/mat.png)
Mathematics, 09.02.2021 05:40
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/en.png)
English, 09.02.2021 05:40
![question](/tpl/images/cats/himiya.png)
Chemistry, 09.02.2021 05:40
![question](/tpl/images/cats/geografiya.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 09.02.2021 05:40