we provide you the c downloads,c programing,c tutorials and much more at www.cplusplus-in.blogspot.com.Codes of c++ are also there for your help.This blog build your c programing style.
Sunday, 8 July 2012
How to calculate the sum of all values in an array
This is the source code to calculate the sum of all the values in an array
#include<iostream.h>
#include<conio.h>
main()
{
int A[5]={3,6,9,12,15};
int sum;
sum=A[0]+A[1]+A[2]+A[3]+A[4];
cout<<"sum="<<sum<<endl;
getch();
}
ReplyDeletenice article for beginners.thank you.
javacodegeeks