give me the code for enter numbers
i need to write codes for input number to an array and count the total value of numbers stored in the array
i'm unable to write input and calculate total of the values of array
give me the code for enter 5 numbers and calculate total of 4 th and 5th number
but i write code for calutale total for an initialized array but this code display all values need to display just total is 100
Code:
int main()
{
int number[4];
number[0]=100;
number[1]=15;
number[2]=23;
number[3]= number[0]+number[1]+number[2];
int index;
for(index=0; index<4; index++)
{
printf( "total is= %d\n",number[index]);
return 0;
}
}