CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2009
    Posts
    2

    Range wont work?

    I want my code to print numbers 1 through 10, only if the input is 1 through 10.
    so if the user inputs 4, i want the numbers 1-10 to print.

  2. #2
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: Range wont work?

    Good for you... do you have any questions for us ?

  3. #3
    Join Date
    Nov 2009
    Posts
    2

    Talking Re: Range wont work?

    sassy i like it..any more of that and my nips will be hard as stone
    what is the code to print?

    int z=9;
    cin>>z;
    if (z>0)
    while (z<10)
    cout<<"1,2,3,4,5,6,7,8,9<<endl; // instead of having to do this?

    also im trying to make the while loop stop printing those numbers. how would i do that?
    i thought by making it 9 it would print once and then the second time around it would be 10, create a false statment and stop printing

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
  •  





Click Here to Expand Forum to Full Width

Featured