In: Computer Science
answer) 7 times # is printed
here i loop runs 10 times.
-->when i=0
if(i == 2 || i==4 || i==6)
{
continue;
}
this if condition is not satisfied so we are not entered into if condtion.so cout<<'#' is printed
-->when i=1
if(i == 2 || i==4 || i==6)
{
continue;
}
this if condition is not satisfied so we are not entered into if condtion.so cout<<'#' is printed
-->when i=2
if(i == 2 || i==4 || i==6)
{
continue;
}
this if condition is satisfied so we are directly go to for loop again with out printing #
-->when i=3
if(i == 2 || i==4 || i==6)
{
continue;
}
this if condition is not satisfied so we are not entered into if condtion.so cout<<'#' is printed
printed
-->when i=4
if(i == 2 || i==4 || i==6)
{
continue;
}
this if condition is satisfied so we are directly go to for loop again with out printing #
-->when i=5
if(i == 2 || i==4 || i==6)
{
continue;
}
this if condition is not satisfied so we are not entered into if condtion.so cout<<'#' is printed
printed
-->when i=6
if(i == 2 || i==4 || i==6)
{
continue;
}
this if condition is satisfied so we are directly go to for loop again with out printing #
-->when i=7
if(i == 2 || i==4 || i==6)
{
continue;
}
this if condition is not satisfied so we are not entered into if condtion.so cout<<'#' is printed
-->when i=8
if(i == 2 || i==4 || i==6)
{
continue;
}
this if condition is not satisfied so we are not entered into if condtion.so cout<<'#' is printed
-->when i=9
if(i == 2 || i==4 || i==6)
{
continue;
}
this if condition is not satisfied so we are not entered into if condtion.so cout<<'#' is printed