I tried to write multiple scanf statements but the program generate some garbage value. Here is the program
This is the answer generated.Code:#include<stdio.h> #include<conio.h> void main() { clrscr(); char a,b,c; printf("Enter three character\n"); scanf("%c",a); scanf("%c",b); scanf("%c",c); printf("The characters entered are %c %c %c", a,b,c); getch(); }
Enter three character
s
d
The characters entered are Å ╖ 2
I am using window 7 x86 version.
Please help with the solution ASAP.
Thank you.