program to print first five odd numbers
Answers
Answered by
5
Answer:
python programming:-
n=1
for a in range(n,9,2):
print(a)
hope it helps you.....
Answered by
4
Python Program :
Explanation:
i=1;#take a variable for the increment for the odd number.
j=1;#take the variable for the increment for the odd number.
while(i<6):#while loop
if(j%2!=0):#condition to check the odd number.
print(j,end=" ")#print the odd number.
i=i+1#increase the value of i.
j=j+1 #increase the value of j.
output :
- The above code will output as : 1 3 5 7 9
Code Explanation :
- The above code is in python language, which holds a while loop which is used to check the number to be odd.
- If the number is odd, then it will be printed by the help of print function.
Learn More :
- Python : https://brainly.in/question/14689905
Similar questions