I wrote my first program, and although the first printing is ok
the second one is something like "!!"and letters after that, and I have no idea why. If it helps at all, i'm also posting my code down there. It's supposed to be hangman-game
int i,s=0,flag=0,n=1,right=0; // Seriously?
int i,s,flag,right=0;
int n=1;
1 2 3 4 5 6 7 8 9 10
char word[21], // Okay, so word is a char?
word[i]=0; // Yet you assign an integer value...
if (word[i]=letter){ // = assigns a value, == compares values.
if (flag=1){ // again ==
if (guess[i]='*'){ and yet again
n=n+1; is n++;
I picked your code apart like that, not to be mean or embarrass you. This looks very much like my first program, you're in good company. :) Your code is very hard to understand, and even harder to read.
Try to get away from using variables like s, i... It's always a lot easier to remember variables that have meaningful names like flag... even though I have no clue what flag does.
which brings me to my last tip... commenting your code. A few comments telling what 's' does, saves a whole lot of scrolling to see how it's used and guessing what it is supposed to do.