79545422

Date: 2025-03-31 03:01:46
Score: 0.5
Natty:
Report link

You almost certainly want to fflush stdout rather than stdin since it doesn't seem your console is flushing output for you on encountering newlines, and you want to do it after you output, but before you do input.

#include <stdio.h>

int main(void)
{
    char letra1, letra2;

    printf("Insira um caractere:\n ");
    fflush(stdout);
    scanf(" %c", &letra1);

    printf("Insira outro caractere: \n");
    fflush(stdout);
    scanf(" %c", &letra2);

    printf("VocĂȘ digitou: '%c' e '%c'", letra1, letra2);
}
Reasons:
  • Blacklisted phrase (3): VocĂȘ
  • Has code block (-0.5):
  • High reputation (-2):
Posted by: Chris