Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

I´ve set an alphanumeric char ("B02") code. The code assigned to card 1 is working while card 2 isn´t

+5 votes
asked Jul 14, 2025 by E Silva (190 points)
char estado1 = 'A';

 char codigo1[5] = "A01";

char estado2 = 'B';
    char codigo2[5] = "B02";

printf("Digite o codigo da Carta 1 (A01): ");
    scanf("%s", codigo1);

 printf("Digite o codigo da Carta 2 (B02): ");
    scanf("%s", codigo2);

1 Answer

0 votes
answered Jul 15, 2025 by Jerry Jeremiah (2,040 points)
It works for me: https://onlinegdb.com/S0Ju-i6ev

They both collect info and you can print it out later.
commented Jul 17, 2025 by E Silva (190 points)
Thanks for your answer, but when I ran the full program, it wasn´t working properly.

If I send you the program, would you try running it to see if the errors are displayed?

I´m studying computer science (1st year), still a lot to learn it..
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...