Thread: noob c ++ question. Summations

  1. #16
    Registered User
    Join Date
    Mar 2011
    Posts
    11
    Quote Originally Posted by Elysia View Post
    Put a different way: what does the code do? Can you write it in pseudo code? How does it work?
    I already did I just don't know how to take the sum of the loop's value. You then said total_resistance += entered_resistance ;

    and I did that and I didn't get the right answer and I have no idea what to do next so thats where I am at now.

  2. #17
    Registered User
    Join Date
    Mar 2011
    Posts
    11
    I got it and it works. I set the total_resistance = 0 and now it works. I also put it inside the for loop. Thanks for the help.

  3. #18
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Putting it inside the for loop was the answer.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #19
    Programming King Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Middle of NoWhere
    Posts
    320
    Quote Originally Posted by fry8 View Post
    total_resistance += entered_resistance ;

    Put this thing inside the loop :-)


    Regards...

  5. #20
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    A little late to the party.
    Plus, it would be good if you don't spoil answers to such elementary logic problems.
    Logic problems are great exercises for newbies which they really must master.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. noob question about RAM
    By crvenkapa in forum Tech Board
    Replies: 2
    Last Post: 03-26-2010, 03:41 PM
  2. Noob Question: Can't compile with "end1"
    By Lillers in forum C++ Programming
    Replies: 2
    Last Post: 01-22-2010, 04:23 AM
  3. quick noob question
    By thanatos1 in forum C# Programming
    Replies: 2
    Last Post: 06-17-2009, 08:28 PM
  4. another noob question
    By clb2003 in forum C Programming
    Replies: 4
    Last Post: 02-12-2009, 01:28 PM
  5. Noob printf question
    By lolguy in forum C Programming
    Replies: 3
    Last Post: 12-14-2008, 08:08 PM