CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 28

Threaded View

  1. #1
    Join Date
    Feb 2009

    Exclamation Please Help- my first program does something weird !

    I just wrote my first program of my own.

    it works...
    but I can't figure out why if you guess the correct number you have to hit " quit " more than once to exit the program. If you guess the right number 4 times, you have to exit 4 times before it actually closes. can someone please point out in my code what is causing this ?

    here's my lame first written program.

    #include <stdio.h>
    #include <conio.h>
    int r;
    int main()
        int c=0;
          while(c <=9){
          printf("Print 10 !\n\n");
          printf("want to re-print ? then you need to find the lucky number !\n\n if you get it wrong you will have to quit !");                
          if(r!=4) break;
          else main();
           printf("click any key to quit");
    any help is appreciated !!

    Last edited by Jeff++; February 9th, 2009 at 05:29 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

By using this site, you agree to the Privacy Policy