I'm new to C programming, I come from a Java background. I was wondering why in the following code, in the while loop I have to type my input ten times and then all ten inputs are displayed. I'm trying to type something once and have it displayed right after. Then continue typing my other inputs.
#include <stdio.h>
#include <stdlib.h>
#include "Helper.h"
main(){
print(PROGRAM_INFO); //prints program name and author
print(PROMPT);
char input [100]; //array to hold input from user
int isActive = 1; //1 continue shell, 0 terminate shell
int count = 0;
while (isActive == 1 && count < 10){
print(PROMPT);
++count;
scanf("%s", input);
print(input);
}
}