write an algorithm to find sum of odd number up to n
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
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