Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Intro_CSharp
- {
- class Program
- {
- static void Main(string[] args)
- {
- int x=2;
- int y = -3;
- Console.Write(x + " ");
- Console.Write(y + " ");
- int count = 0;
- for (int i = 1; i < 99; i++)
- {
- if (i%2==0)
- {
- y-= 2;
- Console.Write(y+" ");
- }
- else
- {
- x += 2;
- Console.Write(x+" ");
- }
- count++;
- }
- Console.WriteLine();
- Console.WriteLine("Total numbers: "+(count+2));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement