Jump to content
xisto Community

LouisStDubois

Members
  • Content Count

    3
  • Joined

  • Last visited

Everything posted by LouisStDubois

  1. Thanks again. I just found a tutorial on FriedSpace that was written for Pelles C and I'm downloading the Eclipse IDE right now.
  2. Hey Thanks. I'm using Borland's Turbo C compiler. I think it's version 2.something. The source code came directly out of the book. I've been using Sams Teach Yourself C in Twenty One Days.
  3. /* Demonstrates the use of if statement with else clause */#include <stdio.h>int x, y;int main(){ /* Input the two values to be tested */ printf("\nInput an integer value for x: "); scanf("%d", &x); printf("\nInput an integer value for y: "); scanf("%d", &y); /* Test values and print result */ if (x == y) printf("x is equal to y\n"); else if (x > y) printf("x is greater than y\n"); return 0;} The above source code comes from the Sams Teach Yourself C in 21 Days. I know how ambitious the title sounds, but it seems to be a good book, and I've tried several tutorials. Anyway what the program does is prompt for a value for x and then runs right through the prompt for the value for y and displays "x is greater than y" because it doesn't wait for you to enter the value for y. Can anyone tell me what's wrong with the code that it does that. I have it here letter for letter and can't figure out how to make it wait for the value for y. I've just recently passed the "Hello World!" phase, so bear with me. Thanks for any help.
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.