Write a c program to print the series of number with skipping the desired number.
#include<stdio.h>
#include<conio.h>
void main()
{ int i ,j ,n;
clrscr();
printf(“Enter the value of n:”);
scanf(“%d”,&n);
printf(“Enter the value of number you want to skip:”);
scanf(“%d”,&j);
for(i=1;i<=n;i++)
{
if(i==j)
{
continue; // skip the number ‘j’
}
else
{
printf(“%d “,i);
}
}
getch();
}
Here the (continue;) is used to continuing the loop without printing the number ‘j’.
This will not break the loop , it just skip that number.
Output