C# Programming - Datatypes - Discussion

Discussion Forum : Datatypes - General Questions (Q.No. 14)
14.
Which of the following are the correct way to initialise the variables i and j to a value 10 each?
  1. int i = 10; int j = 10;
  2. int i, j;
    i = 10 : j = 10;
  3. int i = 10, j = 10;
  4. int i, j = 10;
  5. int i = j = 10;
2, 4
1, 3
3, 5
4, 5
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
2 comments Page 1 of 1.

Meghu said:   1 decade ago
Any one can explain this question in detail?

Nisha said:   10 years ago
2nd option is using the colon in between of initializing.

4th option is declare the value 10 only for j variable.

5th option is wrong initializing method.
(1)

Post your comments here:

Your comments will be displayed after verification.