URI Online Judge Solution 1059 Even Numbers – Solution in C, C++, Java, Python and C#

URI Online Judge Solution URI Solution -Beginner

URI Online Judge Solution 1059 Even Numbers – Solution in C, C++, Java, Python and C#

URI Online Judge Solution 1059 Even Numbers| Beginner
URI Problem Link – https://www.urionlinejudge.com.br/judge/en/problems/view/1059

Problem Name: 1059 Even Numbers Solution
Problem Number : URI – 1059 Even Numbers solution
Online Judge : URI Online Judge Solution
Category: Beginner
Solution Language : C,C plus plus, java, python, c#(c sharp)

URI Online Judge Solution 1059 Even Numbers - Solution in C, C++, Java, Python and C#

URI 1059 Even Numbers Code in C / URI 1059 Even Numbers solution in C:

#include <stdio.h>

int
main() {
int
i;
for
(i = 1; i <= 100; ++i)
{

if
(i % 2 == 0)
{

printf("%in", i);
}
}

return
0;
}

Or Solve URI 1059 problem in another way using another increment system

#include <stdio.h>
int main() {
int
i;
for
(i=2; i<=100; i=i+2)
{

printf("%dn",i);
}


return
0;
}

URI 1059 Even Numbers Code in C++ / URI 1059 Even Numbers solution in CPP:

#include <iostream>
using namespace std;

int
main()
{

for
(int i = 1; i <= 100; ++i)
{

if
(i % 2 == 0)
{

cout << i << endl;
}
}


return
0;
}

URI 1059 Even Numbers Code in java/ URI 1059 Even Numbers solution in Java:


public class
Main {

public static
void main(String[] args) {
int
i;
for
(i = 2; i <= 100; i+=2) {
System.out.println(i);

}
}
}

or just

public class Main {

public static
void main(String[] args) {
int
i;
for
(i = 2; i <= 100; i=i+2) {
System.out.println(i);

}
}
}

Note: 
Use i+=2 instead of i = i+2
Because it is faster than that.

URI 1059 Even Numbers Code in Python / URI 1059 Even Numbers solution in Python:

URI Solution 1059 Even Numbers Code / URI 1059 Even Numbers solution in  C# (C Sharp):

Demonstration:


Note: 
Use i+=2 instead of i = i+2
Because it is faster than that.

Just implement this in coding. Since having any problem just put a comment below. Thanks

Tags: URI Online Judge Solution, URI OJ Solution list, URI Problems Solution, URI solver, URI all problem solution list, URI even number code in C, URI 1059 code in C++, URI 1059 Even Numbers solution in C, URI solution, URI 1059 Even Numbers solution in C,URI 1059 Even Numbers solution in C++-CPP,URI 1002 solution in C# (C sharp),URI 1002 solution in Java,URI 1059 Even Numbers solution in Python,

Leave a Reply

Your email address will not be published.