0

write a c++ program to convert a decimal number to binary number

27th Apr 2021, 12:08 PM
qais
qais - avatar
5 RĂ©ponses
+ 1
qais No I am very busy person.
27th Apr 2021, 2:34 PM
AÍąJ
AÍąJ - avatar
0
#include <iostream> using namespace std; int main() { int n; cout << "decimal num" << "\n"; cin >> n; for (int i = 7; i >= 0; i--) { int k = n >> i; if (k & 1) cout << "1"; else cout << "0"; } return 0; }
27th Apr 2021, 12:09 PM
qais
qais - avatar
0
Hello Your code output is right. What is issue there?
27th Apr 2021, 12:49 PM
AÍąJ
AÍąJ - avatar
0
🅰đŸ…č 🅐🅝🅐🅝🅣 Can I send you a message to help me write a program?
27th Apr 2021, 1:13 PM
qais
qais - avatar