Please help me to write c program in order to calculate value as below:
1 + 3 + 4 + 6 + 7 + 9 + 10 + ...
My Email: [snipped]

Recommended Answers

All 2 Replies

The C language supports mathematical operations. For instance

#include <stdio.h>

int main () {
   int x = 1 + 2 + 3;
   printf ("%d\n", x);
   return 0;
}

Will output 6 .

I dont see an apparent pattern in your numbers so I'm not entirely sure what the ... is to stand for. Is this a well-known sequence I dont recognize?

@L7Sqr
the pattern is that you alternatively add 1 , then add 2 and so on ...

@OP
Please provide more info about the problem statement and post your coding efforts

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.