Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
binary
#include<iostream> using namespace std; void binary(int num) { int rem; if (num <= 1) { cout << num; return; } rem = num % 2; binary(num / 2); cout << rem; } int main() { int dec, bin; cout << "Enter the number : "; cin >> dec; if (dec < 0) cout << dec << " is not a positive integer." << endl; else { cout << "The binary form of " << dec << " is "; binary(dec); cout << endl; } ret
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Zero length array as a class member
Temp 1
C++ standard library formatted input hexadecimal float without prefix or exponent test case
dynamic_cast in assert Causing Error
rang_warnings
accessing private of different type of template
problem_solution_1
Implements.cpp
constexpr internal error
success
Please log in to post a comment.