Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #pragma warning(disable: 4996)
- #define ARRAY_LENGTH 10
- void main()
- {
- int intArray[ARRAY_LENGTH];
- int arraySum = 0;
- for (int i = 0; i < ARRAY_LENGTH; i++)
- {
- intArray[i] = i;
- }
- for (int i = 0; i < ARRAY_LENGTH; i++)
- {
- arraySum += intArray[i];
- }
- printf("The total of the array is %d.\n", arraySum);
- }
Advertisement
Add Comment
Please, Sign In to add comment