write a c++ program to convert a decimal number to binary number | Sololearn: Learn to code for FREE!

0

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

c++

4/27/2021 12:08:59 PM

qais

5 Answers

New Answer

+1

qais No I am very busy person.

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; }

0

Hello Your code output is right. What is issue there?

0

🅰🅹 🅐🅝🅐🅝🅣 Can I send you a message to help me write a program?