πŸ“Š C#
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
πŸ’¬ Discuss
βœ… Correct Answer: (B) Expression assigned to β€˜k’ should be constant in nature

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
353
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
82%
Success Rate