Hi this is a C program. I need you to convert it to C++. Make sure its working thank you Here is the program: #include int main() { int n,i; int a[10]; printf("Decimal Number: "); scanf("%d",&n); for...


Hi this is a C program. I need you to convert it to C++. Make sure its working thank you




Here is the program:




#include
int 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;
}



Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here