I try to get Strng first then get Character from user. But it wont work, the process of getting character will be skipped. But when i try get char first then string, it works! Please assist. TY
Code:
#include <stdio.h>
int main (){
char singleChar;
char text[30]={0};
int count;
printf("String:");
scanf("%s", text);
printf("Character:");
scanf("%c", &singleChar);
//singleChar will automatically proceed without getting input from user
//But when Char is get before String, No problem.
//Test Result
printf("\nCharacter: %c\n",singleChar);
printf("String: %s\n",text);
}