C# Questions Answers-C# function (PartI)


C# function (PartI)

1. What is the purpose of using functions in C# language?
a. Doing specific tasks b. Making the program to run faster
c. Reducing the number of lines of code
Check answer 2. A function can return more than one value.
a. True b. False Check answer 3.In C#, a function needs to be defined using the static keyword, so that it can be called from the Main function.
a. True b. False Check answer 4. If a function returns no value, the return type must be declared as void.
a. True b. False Check answer 5.In a function, The return statement is not required if the return type is anything other than void.
a. True b. False Check answer 6. A local variable declared in a function is not usable out side that function.
a. True   b. False Check answer 7. A function can have more than one parameter. Values of the parameters are passed to the function when it is called.
a. True   b. False Check answer 8. in C#, A function can be overloaded. Overloading a function means you can give the same name to many function, but different in their arguments.
a. True   b. False Check answer


Comments




This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages:
C, C++, C#, Java, VB.NET, Python, VBA,PHP & Mysql, SQL, JSP, ASP.NET,HTML, CSS, JQuery, JavaScript and other applications such as MS Excel, MS Access, and MS Word. However, we don't guarantee all things of the web are accurate. If you find any error, please report it then we will take actions to correct it as soon as possible.