Hi this is a C program. I need you to convert it to a C++ program. make sure its working thank you here is the program: #include #include int main() { char pass[100], guess[100]; //character arrays...


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


here is the program:


#include
#include
int main()
{
    char pass[100], guess[100]; //character arrays to store inputs

    printf("input password: ");
    scanf("%s",pass);   //input pass

    while(1)    //infinite loop
    {
        printf("enter your password: ");
        scanf("%s",guess);  //input guess

        if(strcmp(pass,guess)==0)   //if pass and guess are same
        {
            printf("correct!");         //prints this message
            break;                      //exits from loop
        }

        else    //if pass and guess mismatch
            printf("incorrect!\n");
    }

    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