Write a program to input a number 'n' and print all the odd numbers upto that number.(use for loop)
Answers
Answered by
0
Answer:
hope it helps you please mark me as brainliest
Explanation:
Logic to print odd numbers from 1 to n without 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 it by 2 for each iteration. The loop structure should look like for(i=1; i<=N; i+=2).
Inside the loop body print the value of i.
Similar questions