- #1
jaydnul
- 558
- 15
How do you print text after a scanf statement on the same line? This is what i need the output to look like:
Enter a number here: _%
The _ is the scanf waiting for input. Now when i write the code like this:
printf("Enter a number here: ");
scanf("%d", &x);
printf("%\n");
It won't put the % sign until after i input a value. How should i rewrite this to achieve what I need? thanks in advance!
Enter a number here: _%
The _ is the scanf waiting for input. Now when i write the code like this:
printf("Enter a number here: ");
scanf("%d", &x);
printf("%\n");
It won't put the % sign until after i input a value. How should i rewrite this to achieve what I need? thanks in advance!