noob c ++ question. Summations

This is a discussion on noob c ++ question. Summations within the C++ Programming forums, part of the General Programming Boards category; Originally Posted by Elysia Put a different way: what does the code do? Can you write it in pseudo code? ...

  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をこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,548
    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をこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,548
    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.

Page 2 of 2 FirstFirst 12
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, 03: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, 12:28 PM
  5. Noob printf question
    By lolguy in forum C Programming
    Replies: 3
    Last Post: 12-14-2008, 07:08 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21