Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Mayor's Race.cpp : Defines the entry point for the console application.
- //
- /* James Inglis
- * Introduction to Prgramming
- * Mr.Hunter
- * 11/24/12
- * Project 10 Chapter 7
- */
- #include "stdafx.h"
- #include <stdio.h>
- #define SIZE 4 /* the size of the array */
- #define PERCENT .50 /* the 50% use to calucate the winner */
- void instruction(void);/* Displaying the users instructions */
- int add_total(int a[]);
- int
- main(void)
- {
- int i ,candidates[SIZE] =
- {
- {can_a, can_b, can_c, can_d}
- };
- printf("Enter in the votes for candidate A > ");
- for ( i = 1; i < SIZE; ++i)
- {
- scanf("%d", &candidates[i]);
- }
- printf("Enter in the votes for candidate B > ");
- for ( i = 1; i < SIZE; ++i)
- {
- scanf("%d", &candidates[i]);
- }
- printf("Your total votes for candidate A are %d", candidates[i]);
- printf("Your total votes for candidate B are %d", candidates[i]);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement