Thread: just starting out

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    5

    just starting out

    Hi there

    Ive just started with c and i cant get my for loop to run more than once.
    Any help greatly appreciated!!!
    Code:
    int main()
    {
        int i;
         
        for (i = 1; i  11; i++)
        {
         printf("blah\n");
        }
        return EXIT_SUCCESS
    }
    thanks again

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    5
    sorry im truly not that simple (well who knows!!)

    my problem was that i had a ';' at the end of my for statement!!
    i did actually have the '<' in my code.

    Code:
        int i;
    
        for(i=1; i<11; i++); <-- 
        {
            printf("blah\n");
        }
    
        return 0;
    but thanks for your reply

  3. #3
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >my problem was that i had a ';' at the end of my for statement!!
    Then please post the code exactly as you're trying to compile it. Your first post omits the relational operator and there is no semicolon after the loop; this makes finding your exact problem virtually impossible.

    -Prelude
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Starting programs
    By Molokai in forum C Programming
    Replies: 1
    Last Post: 04-16-2009, 10:10 AM
  2. Interpreter.c
    By moussa in forum C Programming
    Replies: 4
    Last Post: 05-28-2008, 05:59 PM
  3. i am not able to figure ot the starting point of this
    By youngashish in forum C++ Programming
    Replies: 7
    Last Post: 10-07-2004, 02:41 AM
  4. question about reading inputs starting with 0
    By jibbles in forum C Programming
    Replies: 8
    Last Post: 08-09-2004, 03:27 AM
  5. 12 year old starting...
    By Xterria in forum Game Programming
    Replies: 2
    Last Post: 09-24-2001, 07:33 PM