Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.
Login
Login
OnlineGDB Q&A
Questions
Unanswered
Tags
Ask a Question
Ask a Question
write a program that writes even numbers sequentially,
0
votes
asked
Oct 31, 2018
by
anonymous
write a program that writes even numbers sequentially,
Please
log in
or register to answer this question.
1 Answer
0
votes
answered
Jan 22, 2019
by
Jyothi_Rk
#include <stdio.h>
void main()
{
int max,i;
printf("Enter the value till where you would like to print the even numbers\n");
scanf("%d",&max);
for(i=2;i<=max;i++)
{
if((i%2)==0)
printf("%d\t",i);
}
}
commented
Jan 22, 2019
by
Himanshu
num=int(input('Enter Number'))
for x in range(0,num+1):
if x%2==0:
print (x)
Please
log in
or register to add a comment.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...