c++ : binary addition

This is a discussion on c++ : binary addition within the C++ Programming forums, part of the General Programming Boards category; 1. You have no such if expression in your code that you've posted. If you want to do something repeatedly, ...

  1. #31
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    1. You have no such if expression in your code that you've posted. If you want to do something repeatedly, then you need to put it in a loop (if is not a loop).

    2. Then you need to use / and % in a more appropriate manner.

    3. Only if you want to get the right answer.

  2. #32
    Registered User
    Join Date
    May 2011
    Posts
    16
    1. You have no such if expression in your code that you've posted. If you want to do something repeatedly, then you need to put it in a loop (if is not a loop).
    i didn't posted here .. i know i should use a loop
    after writing the loop and the cout .. how i can make the program to STOP ?
    using break , continue ? (i don't know what's the difference between them)

    2. Then you need to use / and % in a more appropriate manner.
    you mean : n/10000 n1=n%10000 .... , or is there another way ?

    3. Only if you want to get the right answer.
    ok how ? changing the arrays order in the summation ?

  3. #33
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,411
    break exits a loop, and continue jumps to the beginning of a loop. Formulate proper logic!
    Break this into smaller pieces, seriously. You keep getting confused over your own code and how to do things properly, so start small again and slowly work your way up as more and more starts working.
    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. #34
    Registered User
    Join Date
    May 2011
    Posts
    16
    ^ the problem is i don't have much time , i have to finsh it soon

  5. #35
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,411
    But you are not getting anywhere, are you?
    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.

  6. #36
    Registered User
    Join Date
    May 2011
    Posts
    16
    !!!!

Page 3 of 3 FirstFirst 123
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 10-08-2010, 01:30 PM
  2. need some help with binary addition.
    By InvariantLoop in forum C++ Programming
    Replies: 21
    Last Post: 01-27-2005, 05:52 AM
  3. New addition
    By RoD in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 11-06-2004, 07:41 PM
  4. saturated binary/hex addition
    By revelation437 in forum A Brief History of Cprogramming.com
    Replies: 13
    Last Post: 03-09-2004, 05:11 PM
  5. Binary tree addition
    By crag2804 in forum C Programming
    Replies: 2
    Last Post: 09-30-2002, 07:48 AM

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