Computer Science, asked by sudhans261, 1 year ago

To print first 10 odd numbers in descending order using while loop

Answers

Answered by akhileshlaliya6397
3
The first 10 odd numbers are: 1, 3, 5, 7 , 9, 11 , 13, 15, 17, 19 In C: ... to calculate the sum of the first 10 natural numbers using a while loop?
Answered by yaah78
0

according \: to \: codition \:  \\ ap \: is \\ 1 \: 3 \: 5...... \\ here  \\ a = 1 \:  \: d = 2 \: n = 10 \\  \\  \green{sn =  \frac{n}{2} (2a + {(n - 1)}d)} \\  \frac{10}{2} (2 \times 1 + (10 - 1) \times 2) \\ 5(2 + 9 \times 2) \\ 5(2 + 18) \\ 5(20) \\ 5 \times 20 \\ 100 \\  \\  \boxed{sum \: of \: first \: ten \: odd \: number \: is \: 100}

Similar questions