2075 6

C Programming20755 marksDecision Making and Looping

Write a program to calculate sum of first 10 odd numbers.

Write a program to calculate sum of first 10 odd numbers. [5]

The first 10 odd numbers are: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19 We use a for loop to iterate through numbers and check whether each number is odd using the condition num % 2 != 0. We keep a count of how many odd numbers have been found and add them to the sum until the count reaches 10. --- --- -...

Up nextWhat is preprocessor directive? Discuss #define derivative with example. [1.5+3.5]