So basically I have a a program in C, whose point is to look organized. I'd like my program's cursor not to move after I confirm my Scanf statement. Heres example part of my program and its output:
#include <stdio.h>
int main()
{
char input[10];
int voltage=220;
printf("What do you want to know\n"); //no need to correct me on this part please
scanf("%s", input);
if (strcmp("voltage",input)==0)
printf(" = %d\n", voltage);
/* Imagine other string comparisons (resistance, current) here*/
return 0;
}
So this program for input "voltage" would output something like this: voltage //what I just inputed via scanf = 220 // \n because I pressed enter after inputing.
What I wanted is:
voltage = 220
I dont know Is there reverse \n function that I dont know about.