Computer Science, asked by daksheshapkare, 18 days ago

find the sum of odd number till n in c++​

Answers

Answered by mrudulaturankar
1

Answer:

To find sum of odd numbers we must iterate through all odd numbers between 1 to n. Run a loop from 1 to N , increment 1 in each iteration. The loop structure must look similar to for(i=1; i<=N; i++) . Inside the loop add sum to the current value of i i.e. sum = sum + i .

Similar questions