0
write a c++ program to convert a decimal number to binary number
5 Respuestas
+ 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?