Thread: Making the Number add up

  1. #1
    Registered User
    Join Date
    Jan 2004
    Posts
    68

    Talking Making the Number add up

    ok say i've got an array called

    Sales[count]

    the value of Sales[1] is 4000 and next time when the user enters the value for Sales[1] instead of replacing the number it adds to the number

    eg

    Sales[1]=4000
    User enters number 5000 for Sales[1]
    and instead of Sales[1] becoming 5000 it becomes 9000.
    -Ti22-

  2. #2
    ~viaxd() viaxd's Avatar
    Join Date
    Aug 2003
    Posts
    246
    Code:
    printf("Enter number :\n");
    scanf("%d",&n);
    
    Sales[1] += n;
    is that it?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 11
    Last Post: 10-07-2008, 06:19 PM
  2. adding a number to a number
    By bigmac(rexdale) in forum C Programming
    Replies: 11
    Last Post: 10-24-2007, 12:56 PM
  3. Help with making a random number
    By Sebastion in forum C++ Programming
    Replies: 16
    Last Post: 03-16-2006, 07:18 PM
  4. Help needed Please
    By jereland in forum C Programming
    Replies: 9
    Last Post: 03-18-2004, 05:30 AM
  5. Replies: 3
    Last Post: 01-14-2003, 10:34 PM