I tried this code
#include <stdio.h>
int main() {
int num;
printf("Enter a number: ");
scanf("%d", &num);
printf("You entered: %d. Next, let's print on the same line: ", num);
printf("This is the output on the same line.\n");
return 0;
}
And my output is this:
Enter a number: 10
You entered: 10. Next, let's print on the same line: This is the output on the same line.
But I want this output instead:
Enter a number: 10You entered: 10. Next, let's print on the same line: This is the output on the same line.
Basically I do not want the cursor to skip a line after I provide an input.