Simple Program - Printing Out Letters

Hello again!

1
2
3
4
5
6
7
8
9
10
11
12
#include <stdio.h>
int main ()
{
	char a,b,c;
	printf("Enter the 1st character: ");
	scanf("%s",&a);
	printf("\nEnter the 2nd character: ");
	scanf("%s",&b);
	printf("\nEnter the 3rd Character: ");
	scanf("%s",&c);
	printf("\n\n%c,%c,%c all are letters.",a,b,c);
}


Made this code from before I just didn't bother it till now..
I'm getting good output but after getting it all, a window appears saying that..
Debug Error or Run-Time Failure.

also if you noticed I made the %c to %s in scanf..
because if I made it to %c, it escapes the second scanf..
but in this case I don't get the Debug Error Window..

and if I made all in %s,
the last printf isn't printed on the output..
#just_saying coz that's what I experience..

So I just want to know if it's alright to leave it like that?
Last edited on
Topic archived. No new replies allowed.