Advertisements
Advertisements
प्रश्न
Observe the following code. It may contain Syntax, Logical or runtime errors. Execute it in Java and identify the error, if any. Rewrite the code without the error. Also write the aim of the code.
int int fnWork(int p, intq)
{
int s=p b;
int r=p*q;
return s;
return r;
}अति संक्षिप्त उत्तर
Advertisements
उत्तर
No error. If n is even, then return its square; else return its cube.
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 3: User-Defined Methods - Exercises [पृष्ठ ९२]
