WAP to print all even numbers between 2 to 20
Answers
Answered by
3
#include<stdio.h>
main()
{
int n;
for(int i
= 2;i <= 20;i=i+2)
{
printf("%d\n"i);
}
return 0;
}
Answered by
2
#include<iostream.h>
void main()
{
int I=1;
cout<<"Even numbers between 1 and 20n";
do{
if(I%2==0)
cout<<I<<"n";
I++;
}while(I<=20) ;
}
void main()
{
int I=1;
cout<<"Even numbers between 1 and 20n";
do{
if(I%2==0)
cout<<I<<"n";
I++;
}while(I<=20) ;
}
Similar questions