The Kingdom of Zumbania recently banned the number 7. Please print all the numbers from 1 to N but skip all multiples of 7. Also, skip any number that has a 7 in it, such as 27.
Input Format
Input line represents an integer n
Constraints
No Constraints
Output Format
The output line print all the numbers separated by space
Sample Input 0
20
Sample Output 0
1 2 3 4 5 6 8 9 10 11 12 13 15 16 18 19 20
Program :
#include<stdio.h>
int main()
{
int n,i;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
if(i%7==0 || i==17)
{
continue;
}
else
{
printf("%d ",i);
}
}
return 0;
}
0 Comments