Thread: Some basic things

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    24
    Yes, it does break after each case, that's why I wasn't sure. I think I get the code. vowels ++ means it will add +1 to the vowels integer, it seems? And can I use something similar to your code for the a^b exercise? (For example for printing the result, or any variables that need to be declared?)

    I hope I am not bothering you by all these questions, but everything you said so far has been really helpful already.

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by Nathalie View Post
    vowels ++ means it will add +1 to the vowels integer, it seems?
    Yes, that is correct.

    And can I use something similar to your code for the a^b exercise? (For example for printing the result, or any variables that need to be declared?)
    Abda92 posted an excellent code. Basically just multiply againt the same variable X number of times:
    Code:
    int num = 10;
    // Let's do 10 ^ 5
    for (int i = 0; i < 5; i++) num *= num;
    Reads: While i < 5 (starting from 0), multiply num against num and store the result in num.

    I hope I am not bothering you by all these questions, but everything you said so far has been really helpful already.
    Not at all. That's why we're here - to help!

  3. #3
    Registered User
    Join Date
    Nov 2007
    Posts
    24
    Okay, thanks for explaining once again! One tiny question more: how do you print the result of the a^b thing?

    ETA: dwks, that means I have to replace every “&#37;d” by some other text? What kind of? I didn't write that code, I asked somebody else for help but he was unable to explain or go on any further.
    Last edited by Nathalie; 11-10-2007 at 02:20 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. noob with basic q's
    By SimplyComplex in forum C++ Programming
    Replies: 8
    Last Post: 11-19-2006, 01:17 PM
  2. Basic things I need to know
    By maxorator in forum C++ Programming
    Replies: 53
    Last Post: 10-15-2006, 04:39 PM
  3. what are your thoughts on visual basic?
    By orion- in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 09-22-2005, 04:28 AM
  4. visual basic vs C or C++
    By FOOTOO in forum Windows Programming
    Replies: 5
    Last Post: 02-06-2005, 08:41 PM
  5. Basic Window Creation, Dev C++ 4.9.9.0 Linking Error
    By Tronic in forum Windows Programming
    Replies: 2
    Last Post: 11-27-2004, 06:03 PM