Sorry, I am fairly new to C, could you explain a bit more regarding the changing of N from a constant to a variable? Also, is it possible to change the read line from a count function to one that...
Type: Posts; User: chillbox
Sorry, I am fairly new to C, could you explain a bit more regarding the changing of N from a constant to a variable? Also, is it possible to change the read line from a count function to one that...
Hi guys,
I am currently working on a c program, that involves arrays. So far, I have definted the array as follows:
#define N 999
Well, the first sum takes the first and last terms of the array. So i was wondering how to do the sum without including those, if that makes sense? And in response to your question, I think he means...
/*Summation of first and last terms*/
sum1 = values[0] + values[N-1];
/*Summation of Odd terms*/
for (j=1; j<=N-1;j+=2)
sum2 = values[j];
where values is my array. I can't get...
Hi there guys,
I am currently writing a pretty basic c program, but sort of hit a road block. Basically, I have an array of say 20 values. What is the syntax for calculating the sum of say just...