C Programming language

adplus-dvertising
C Program example: Simple Array program
Previous Home Next
A simple Array program example
#include<stdio.h>
#include<conio.h>
void main()
{
	int a[] = {20, 30, 50, 70, 100};
	int n, sum=0;
	for ( n=0 ; n<5 ; n++ )
	{
		sum += a[n];
	}
	printf ("%d", sum);
	return 0;
}
Output:270
Previous Home Next