Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,800 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
static void Main(string[] args)
{
const int count = 26;
int[] ch1 = new int[count];
int[] ch2 = new int[count];
for (int i = 0; i < ch1.Length; i++)
{
ch1[i] = 1;
}
for (int i = 0; i < ch2.Length; i++)
{
ch2[i] = 1;
}
Console.WriteLine(ch1.Sum() + ch2.Sum());
Console.ReadKey();
}
Hi
If I understood correct , you want to create 2 array of length 26 and assigned the value 1 individually in array ch1 and ch2 , and you want to sum all the element of array and then add both array , right?
Equivalent Python code:
from array import *
ch1 =array('i',[])
ch2 =array('i',[])
for i in range(26)
ch1.append(1)
for i in range(26)
ch2.append(1)
print(sum(ch1)+sum(ch2))
Let me know if you have any doubt ?