Thread: code for hexadecimal calculator

  1. #1
    Unregistered
    Guest

    code for hexadecimal calculator

    Does anybody have code for a simple hexadecimal calculator

  2. #2
    Registered User
    Join Date
    Dec 2001
    Posts
    421
    how about you write your own??

    it's just the same as decimal... just make sure you read in as hex, and output as hex.. the rest is done just like decimal!

    use your head.
    U.
    Quidquid latine dictum sit, altum sonatur.
    Whatever is said in Latin sounds profound.

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    752
    Code:
    // Adds 2 hexadecimal numbers together...
    int main (void)
    {
     int a, b, c;
     printf ("Two numbers please.\n");
     scanf ("%x%x", &a, &b);
     c = a + b;
     printf ("%X", c);
     return 0;
    }
    Callou collei we'll code the way
    Of prime numbers and pings!

  4. #4
    Unregistered
    Guest
    Thanks Question C this gives me a good start

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 03-21-2006, 07:52 AM
  2. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  3. True ASM vs. Fake ASM ????
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 04-02-2003, 04:28 AM
  4. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM
  5. Replies: 4
    Last Post: 01-16-2002, 12:04 AM