Problem with compiler

Discussion in 'C' started by m_ishwar, Aug 28, 2010.

  1. m_ishwar

    m_ishwar Guest

    I am experiencing a problem with turbo c while I execute odd loops. The compiler doesnt wait till I give a yes or a no. It just jumps out of the loop. Can anyone help me?Is it a problem with the compiler or my program. The latter is not possible since I tried out a similar program from a book and got similar results. I have Turbo C v3.0 downloaded from the internet.Also, the compiler doesn't seem to understand getch and clrscr functions.
    Program was;

    #include
    void main()
    {
    int i;
    char q='y';
    while(q=='y')
    {
    printf("Enter the number");
    scanf("%d",&i);
    printf("The number you have entered is %d",i);
    printf("Want to enter another number y/n\n")
    scanf("%c",&q);
    }
    }
     
  2. victoryforce

    victoryforce New Member

    Joined:
    Jan 1, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    when the for loop used in a c program
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice