K
K
K A2019-02-24 02:14:38
Arrays
K A, 2019-02-24 02:14:38

Is it implemented correctly?

using System;

class ArraySymbs
{
    static void Main()
    {
        int size = 10;
        char k = 'a';
        
        char[] symbs = new char[size];
        for (int i = 0; i < symbs.Length; i++)
        {
            symbs[i] = k;
            Console.WriteLine(symbs[i]);
            int s = k + 2;
            k = (char)s;
        }
        Console.ReadKey();
    }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Bashinsky, 2019-02-24
@BashkaMen

what is it?
my implementation

var size = 10;
var k = 'a';
var nums = Enumerable.Range(1, size).Select(s => (char)(k + s * 2)).ToArray();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question