Thread: Same birthday

  1. #16
    Registered User
    Join Date
    Oct 2010
    Posts
    33
    it's telling me that I don't have enough privilege to access private messaging

  2. #17
    Registered User carrotcake1029's Avatar
    Join Date
    Apr 2008
    Posts
    404
    No worrys, it probably just wants you to get a certain post count or something.

    If allocating memory scares you, try out this little bit:
    Code:
    int main (void)
    {
        int guests, parties;    
        int i, j;
        int same = 0;
        
        printf("How many guests will be attending?\n");
        scanf("%d", &guests);
        
        int birthdays[guests];
        
        printf("How many parties are there?\n");
        scanf("%d", &parties);
    This will only work however is your compiler is C99 supported.

  3. #18
    Registered User
    Join Date
    Oct 2010
    Posts
    33
    int bDays[Guests] doesn't work. I need a constant. Maybe 366 will work lemme give it a shot

  4. #19
    Registered User
    Join Date
    Oct 2010
    Posts
    33
    I have another approach to this:

    Code:
    main()
    
    initialize guest
    initialize party
    
    create loop for party
       call int party(int n) function //n being number of guests
    break party loop
    
    int party(int n)
    set birthdays for parties
    nested for loop to compare each
    
    return 1 if birthdays are identical

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. birthday paradox
    By Jackie Chan in forum A Brief History of Cprogramming.com
    Replies: 40
    Last Post: 06-15-2008, 12:30 PM
  2. Happy Birthday Kermi!
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 05-17-2006, 02:34 PM
  3. Happy Birthday Govtcheez
    By sean in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 07-27-2004, 07:45 PM
  4. My birthday present to myself
    By Liger86 in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 01-25-2003, 09:49 PM
  5. Happy Birthday ethic!
    By Govtcheez in forum A Brief History of Cprogramming.com
    Replies: 27
    Last Post: 03-12-2002, 12:33 PM