C# Corner

C# Corner

  • Tech Writer
  • 8
  • 1.4k

how to do this nested loop

Dec 15 2018 10:44 AM
a nested loop such that the inner loop is exected n times and the outer loop in executed m times.
Within the inner loop add 2 to the value of the varaible sum.
 
using System;

namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
int n = 4; int m = 3;
int sum = 0;



Console.WriteLine(sum);
}
}

Answers (2)