URI - BEECROWD - BEE 1059 - Even Numbers Solution in C,C++,Python | URI - BEECROWD - BEE Online Judge Solution 1059 - Even Numbers
Write a program that prints all even numbers between 1 and 100, including them if it is the case.
Input
In this extremely simple problem there is no input.
Output
Print all even numbers between 1 and 100, including them, one by row.
Input Sample | Output Sample |
2 |
URI 1059 - Even Numbers Solution in C,C++,Python | URI Online Judge Solution 1059 - Even Numbers :
Demonstration:
Even numbers are those numbers that can be divided into two equal groups or pairs and are exactly divisible by 2.
Here we apply a range-based for loop which provides all the integers available in the input interval.
After this, a check condition for even numbers is applied to filter all the odd numbers.
N.B: Don't copy paste the code as same. Just try to understand it and try yourself. It would be better for you.
URI Problem 1059 Solution in C :
#include <stdio.h>
int main() {
int i;
for(i=2; i<=100; i=i+2)
{
printf("%d\n",i);
}
return 0;
}
0 Response to URI - BEECROWD - BEE 1059 - Even Numbers Solution in C,C++,Python | URI - BEECROWD - BEE Solution 1059 - Even Numbers
Post a Comment