If u get a input from.user for example 4 and want to generate a loop of even numbers if u generate numbers like 2,4,6,8 then how | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

If u get a input from.user for example 4 and want to generate a loop of even numbers if u generate numbers like 2,4,6,8 then how

can i delete a number which was input i want a output without user input number or skip the user input number like 2 6 8

10th Jun 2018, 12:58 PM
Hassan Abbas
Hassan Abbas - avatar
3 Answers
+ 4
AS Meet Mehta as said store the input in a variable. Create a loop starting from 1 to n number. Make an if-else statement to skip the odd numbers by continue. And also if the i is equal to the input.
10th Jun 2018, 1:35 PM
Akash Pal
Akash Pal - avatar
+ 1
Store user input in a variable and in for loop use if statement in which set condition that if value is equal to user input than use continue; statement which skip that particular iteration.
10th Jun 2018, 1:08 PM
Meet Mehta
Meet Mehta - avatar
0
thank u bro
20th Jun 2018, 12:00 PM
Hassan Abbas
Hassan Abbas - avatar