Computer Science, asked by greyishsoul, 10 months ago

In C, how do you write a code to open a file and write 100 odd numbers starting 21, close the file, open it again in read mode, and then read the numbers from the file and print them in reverse order?

Answers

Answered by sunitasharmasujal
0

Answer:

Here is your answer buddy

\huge\bold\purple{answer}

Logic to print odd numbers from 1 to n using if statement

Input upper limit to print odd number from user. Store it in some variable say N .

Run a loop from 1 to N , increment loop counter by 1 in each iteration. ...

Inside the loop body check odd condition i.e. if a number is exactly divisible by 2 then it is odd.

\huge\bold\blue{Thanks}

Similar questions