Computer Science, asked by shettypooja926, 5 months ago

write an algorithm to find sum of odd number up to n​

Answers

Answered by simra4825
1

Answer:

HEY MATE HERE'S YOUR ANSWER

Explanation:

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 .

HOPE IT WILL HELP YOU PLZ MRK AS BRAINLIST

DON'T FORGET TO FØLLØW ME

HV A GOOD DAY

Similar questions