Computer Science, asked by friendlysweety34, 5 months ago

write a program to print all the odd numbers between 1 to 21 urgent please....​

Answers

Answered by TheUnknownLily
6

 \bigstar \mathbb{ANSWER} \bigstar

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

2 } Run a loop from 1 to N, increment loop counter by 1 in each iteration. The loop structure should look like for(i=1; i<=N; i++).

3 } Inside the loop body check odd condition i.e. if a number is exactly divisible by 2 then it is odd. Which is if(i % 2 != 0) then, print the value of i.

Program to print odd

 \boxed{MAYBE \qquad CORRECT}

Similar questions