write an algorithm to print all the odd numbers from 10 to 50
Answers
Answered by
1
Answer:
Now the next step (i.e. remainder==0) simply checks if the remainder value is equal to 0 or not. So if the remainder is 0, then the number is said to be Even number else it is said to be an Odd Number.
Answered by
0
Explanation:
It's simple all you have to do this:-
We know universal formula for odd numbers which is "2n+1" Hence we can use this formula to distinguish odd numbers from even numbers
1.Using formula 2n+1
2.The first odd number between 10 and 50 is 11
3.Hence 2n+1=11; 2n=10; n=5
4.The last odd number between 10 and 50 is 49
Hence 2n+1=49; 2n=48; n=24
So to find all the odd numbers between 10 and 50 all you have to do is substitute n=5,6,7.... 24 in the equation 2n+1
Hope this helped you :)
Similar questions