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 ConsoleApplication4
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Enter a positive integer: ");
- int n = int.Parse(Console.ReadLine());
- int[] array = new int[n];
- Console.WriteLine("Enter the values of the array: ");
- for (int i = 0; i < n; i++)
- {
- array[i] = int.Parse(Console.ReadLine());
- }
- bool symmetric = true;
- for (int j = 0; j < array.Length / 2; j++)
- {
- if (array[j] != array[n - j - 1])
- {
- symmetric = false;
- }
- }
- Console.WriteLine("Is symmetric: {0}", symmetric);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment