Examveda

What is the correct way to define a method named GetSquare that takes an integer parameter num and returns its square in C#?

A. GetSquare(num)

B. int GetSquare = (int num) { return num * num; }

C. int GetSquare(int num)

D. int GetSquare(num) { return num * num; }

Answer: Option C


Join The Discussion

Related Questions on Functions and Methods in C Sharp