This is my code:
i Input characters then replace it with hyphens. however, sigma and smiley faces are produced when print it.
Code:#include <stdio.h> void main ( ) { int a; char s[80], b[80]; clrscr (); for (a=0;a<80;a++) { s[a] = '.'; } printf ("Type a string less than 80 characters: "); gets (s); printf ("The string types is:"); puts(s); for (a=0;a<80;a++) { if ((s[a]==' ')||(s[a]==' ')||(s[a]=='.')) { b[a]=' '; } else { b[a]='-'; } } puts(b); getch (); }