Datatypes on C# related Questions and Answers


Question :   Which of the following is the correct ways to set a value 3.14 in a variable pi such that it cannot be modified?
1. float pi = 3.14F;
2. #define pi 3.14F;
3. const float pi = 3.14F;
4. const float pi; pi = 3.14F;
5. pi = 3.14F;
Answer :   3 - const float pi = 3.14F;  

* Be the First to Post a Comment.

Submit comment :


Captcha Image
Reload

Ask Question

Captcha Image
Reload

Note : Name and Email never shown.





Subscribe


Become a part of EducationForever. Subscribe to our FREE Newsletter