Write a program where 1 to 7 should be printed 8 9 10 should not be and 11 to 20 should be using a break and continue.
Write a C program where 1 to 7 should be printed 8 9 10 should not be and 11 to 20 should be using a break and continue.
Please add the code in different languages in the comments sections below
Login/Signup to comment
#include
int main()
{
int i=0;
for(i=1;i7 && i<11)
continue;
printf("%d ",i);
}
return 0;
}
#include
int main()
{
int i;
for(i=1;i7&&i<11)
continue;
printf("%d",i);
}
return 0;
}
Cout<<"1 2 3 4 5 6 7 11 12 13 14 15 16 17 18 19 20"<<endl;
i=1
for i in range(1,21):
if i==8 or i==9 or i==10:
continue
else:
print(i,end=”,”)
#include
int main()
{
int i;
for (i = 1; i <= 20; i++)
{
if(i==8 || i==9 || i==10)
{
continue;
}
else
{
printf("%d ",i);
}
}
return 0;
}
#include
using namespace std;
int main()
{
int i;
for(i=1;i<=20;i++)
{
if(i==8 || i==9 || i==10)
continue;
else
cout<<i<<endl;
}
}
Thanks for contributing the code Thanuja
#include;
using namespace std;
int main()
{
int t1 = 0, t2 = 1, nextTerm = 0, n;
cout <> n;
cout << "Fibonacci Series: " << t1 << ", " << t2 << ", ";
nextTerm = t1 + t2;
while(nextTerm <= n)
{
cout << nextTerm << ", ";
t1 = t2;
t2 = nextTerm;
nextTerm = t1 + t2;
}
return 0;
}
c
Anything increased now is slightly positive and without experience,
could be huge upon the bankroll.