Hi this is a C program. I need you to convert it to C++. Make sure its working thank you
Here is the program:
#includeint main() { int n,i; int a[10]; printf("Decimal Number: "); scanf("%d",&n); for (i=0; n>0; i++) { a[i]=(n%2); n=n/2; } printf("%s","Binary Equivalent: "); for (i=i-1; i >=0; i--) { printf("%d",a[i]); } return 0;}
n=n/2; } printf("%s","Binary Equivalent: "); for (i=i-1; i >=0; i--) {
printf("%d",a[i]); }
return 0;}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here