You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
385 B
C
18 lines
385 B
C
5 years ago
|
#include <stdio.h>
|
||
|
#define SIZE 12
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
int a[ SIZE ] = { 1, 3, 5, 4, 7, 2, 99, 16, 45, 67, 89, 45 };
|
||
|
int i;
|
||
|
int total = 0;
|
||
|
|
||
|
for ( i = 0; i < SIZE; i++ ) {
|
||
|
total += a[ i ];
|
||
|
}
|
||
|
|
||
|
printf( "Total of array element values is %d\n", total );
|
||
|
|
||
|
return 0;
|
||
|
|
||
|
}
|