Skip number 50 by using continue

for(var i=1;i<=100;i++)
{
//code here

}
print [1,2,3...49....51]; //break;
2 Likes
for(var i=1;i<=100;i++)
{
//code here
console.log(i);
if(i==50)
{
continue;}
}
2 Likes

@pavana.two.r ,

Your logic is correct, but you have to make a slight modification to your code as shown below to get the output in the correct manner.

for(var i=1;i<=100;i++)
{

if(i==50)
{
continue;
}
  console.log(i);
}