Hello, I am trying to write a program to take a character, then take another character and print both of them with a - in between.
However I can't seem to get the second scanf to work. The first one works fine
It just skips it and goes straight to the last printf function.
I can't see where my program is going wrong, or could it be the compiler? Any help appreciated.Code:#include <stdio.h> char a,b; int main(){ printf("First character: "); scanf("%c",&a); printf("Second character: "); scanf("%c",&b); printf("%c, %c",a,b); getchar(); }
thanks
ollie