2

I'm running a simple C program in CLion on Windows:

#include <stdio.h>

int main() {
    char c;
    scanf("%c", &c);
    printf("%c", c);
    return 0;
}

When I input a character (e.g., 0) and press Enter, the output appears with a blank line in between. Here's what I see in the Run window:

0     ← input
       ← unexpected extra line
0     ← output

The **output when running the program in CLion looks like this: enter image description here

This is not what happens when I run the same code in a terminal like CMD or PowerShell — only CLion seems to show this extra newline between input and output.

2

1 Answer 1

0

Go to Run -> Edit Configurations -> Additional options -> Check "Emulate terminal in the output console"

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.