Thread: If statement not working

  1. #1
    Registered User
    Join Date
    Sep 2013
    Location
    Jamaica
    Posts
    134

    If statement not working

    Well.... the first if statement doesn't work at all:

    Code:
    if (isalpha(x) || x > 50 || x < 1)
    	{
    		printf("Invalid entry.");
    	}
    	else
    	{
    		if(x == number)
    		{
    			printf("You won!!");
    		}
    		else
    		{
    			printf("You lost. ");
    			printf("The value generated was: %d", x);
    		}
    	}

  2. #2
    Registered User
    Join Date
    Sep 2013
    Location
    Jamaica
    Posts
    134
    NEVERMIND, I found the problem wrong variable in if statement

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. cout statement not working....i think...
    By hex_dump in forum C++ Programming
    Replies: 5
    Last Post: 05-21-2013, 01:08 AM
  2. The following if statement is not working!...
    By darkmagic in forum C Programming
    Replies: 5
    Last Post: 06-23-2010, 08:11 AM
  3. cin.get(); not working with my switch statement
    By tenor_jazz13 in forum C++ Programming
    Replies: 2
    Last Post: 01-12-2008, 10:33 PM
  4. If/else statement not working
    By zenovy in forum C++ Programming
    Replies: 1
    Last Post: 01-18-2006, 08:26 PM
  5. If statement not working!
    By Unregistered in forum C++ Programming
    Replies: 5
    Last Post: 03-02-2002, 02:45 AM