What Will Be The Error In The Following C Codep Pre Langcsharp #4
What will be the error in the following C# code?</p> <pre><code class="language-csharp" line="1"> Static Void Main(String[] args) { const int m = 100; int n = 10; const int k = n / 5 * 100 * n ; Console.WriteLine(m * k); Console.ReadLine(); } </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs108 CSharp. It can also be found in gs gs108 Data Types, Variables and Operators - Integer Data Types - Quiz No.1.
What will be the error in the following C# code?
Static Void Main(String[] args) { const int m = 100; int n = 10; const int k = n / 5 * 100 * n ; Console.WriteLine(m * k); Console.ReadLine(); }
‘k’ should not be declared constant
Expression assigned to ‘k’ should be constant in nature
Expression (m * k) is invalid
‘m ‘ is declared in invalid format