1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Problem with compiler

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

  1. m_ishwar

    m_ishwar New Member

    Joined:
    Aug 28, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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;

    Code:
    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);
            }
    }
     

Share This Page