A

Admin • 802.91K Points
Coach

Q. What will be the error in the following C# code?

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();
}
  • (A) ‘k’ should not be declared constant
  • (B) Expression assigned to ‘k’ should be constant in nature
  • (C) Expression (m * k) is invalid
  • (D) ‘m ‘ is declared in invalid format
  • Correct Answer - Option(B)
  • Views: 8
  • Filed under category C# (C Sharp)
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.