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.
printf("Enter the number");
printf("The number you have entered is %d",i);
printf("Want to enter another number y/n\n")
>Can anyone help me?
Post your code, or a suitable facsimile of your code that exhibits the problem.
>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.
It's not possible that you wrote bad code? It has to be a problem with the compiler? Keep in mind that Turbo C was a mature environment in its day, and a bug in simple loop execution isn't exactly one of those deep dark corners where I'd expect new bugs to be found by beginners in a popular and well tested compiler.
Oh, I see you edited your post with some code. The problem is that the second scanf is reading a newline character left over from the previous call to scanf. 'y' != '\n', so the loop terminates. This is a classic problem with stream input in C. Search the forum for flushing stdin and you'll find plenty of discussions on the topic.
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...
Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...