Console.WriteLine("———————————————————————————————————————————");Console.WriteLine("Program to print the even and odd numbers");Console.WriteLine("———————————————————————————————————————————");Console.WriteLine("Even numbers are:");for(inti=0;i<=15;i++){if(i%2==0){Console.WriteLine(i);}}Console.WriteLine("———————————————————————————————————————————");Console.WriteLine("Odd numbers are:");for(inti=0;i<=15;i++){if(i%2==1){Console.WriteLine(i);}}Console.WriteLine("———————————————————————————————————————————");
Output
kodingwindow@kw:~/csharp$ dotnet run
———————————————————————————————————————————
Program to print the even and odd numbers
———————————————————————————————————————————
Even numbers are:
0
2
4
6
8
10
12
14
———————————————————————————————————————————
Odd numbers are:
1
3
5
7
9
11
13
15
———————————————————————————————————————————
kodingwindow@kw:~/csharp$
Dear User, Thank you for visitng KodingWindow. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.