• 0
Votes
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /var/www/html/cnasolution/application/views/question.php
Line: 191
Function: _error_handler

File: /var/www/html/cnasolution/application/controllers/Questions.php
Line: 419
Function: view

File: /var/www/html/cnasolution/index.php
Line: 315
Function: require_once

Hi i am new to C i am writing a basic hangman game and when i run the code the else statement still triggers even if the if statement before it has triggered why does this happen

Here is the code :

#include   int main(int argc, char const *argv[]) {   int Guesses = 0;   int Completion = 0;   char UserGuess;   char Word[] = "fire";    while (Guesses < 6) {     if (Completion == 4) {       printf("You Won
");       break;     }      printf("Please Enter Your Guess It Can Only Be A Letter Not A Word
");     printf("The Word Is 4 Characters Long
");      scanf("%c", &UserGuess);      if (UserGuess == 'f') {       printf("You Guessed One Of The Letters
");       printf("f_ _ _
");       Completion++;     }      if (UserGuess == 'i') {       printf("You Guessed One Of The Letters
");       printf("_i_ _
");       Completion++;     }      if (UserGuess == 'r') {       printf("You Guessed One Of The Letters
");       printf("_ _r_ 
");       Completion++;     }      if (UserGuess == 'e') {       printf("You Guessed One Of The Letters
");       printf("_ _ _e
");       Completion++;     }     else {       printf("You Guessed The Letter Wrong try again
");       Guesses++;     }   } } 
Download script demo [LINK]
Download script demo [LINK 2] Download script demo [LINK 2]
c