Advertisement
jinglis

inglis

Nov 26th, 2012
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.92 KB | None | 0 0
  1. // Mayor's Race.cpp : Defines the entry point for the console application.
  2. //
  3. /* James Inglis
  4.  * Introduction to Prgramming
  5.  * Mr.Hunter
  6.  * 11/24/12
  7.  * Project 10 Chapter 7
  8.  */
  9.  
  10.  
  11. #include "stdafx.h"
  12. #include <stdio.h>
  13. #define SIZE 4       /* the size of the array */
  14. #define PERCENT .50  /* the 50% use to calucate the winner */
  15. void instruction(void);/* Displaying the users instructions */
  16. int add_total(int a[]);
  17.  
  18.  
  19. int
  20. main(void)
  21. {
  22.     int i ,candidates[SIZE] =
  23.     {
  24.         {can_a, can_b, can_c, can_d}
  25.     };
  26.  
  27.     printf("Enter in the votes for candidate A > ");
  28.  
  29.     for ( i = 1; i < SIZE; ++i)
  30.     {
  31.         scanf("%d", &candidates[i]);
  32.     }
  33.  
  34.     printf("Enter in the votes for candidate B > ");
  35.  
  36.     for ( i = 1; i < SIZE; ++i)
  37.     {
  38.         scanf("%d", &candidates[i]);
  39.     }
  40.  
  41.     printf("Your total votes for candidate A are %d", candidates[i]);
  42.     printf("Your total votes for candidate B are %d", candidates[i]);
  43.  
  44.     return 0;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement