Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What is the output for the next code?

 class trix 

 {

     int act(int n) 

     {

         int result;

         if (n ==1)

         return1;

         result = act(n -1) * n;

         return result;

     }

 } 

 class Output 

 {

     static void main(String args[]) 

     {

         trix obj = new trix() ;

         Console.WriteLine(obj.act(7)*(2));

     }

 }

 

user-image
Question added by Nabil Rageh , Technical Support Manager , DenTech for communication and Information Technology
Date Posted: 2017/02/18
Ahmed Gamal Soliman
by Ahmed Gamal Soliman , Senior Oracle Adf Developer , Personal Project

I dont understand class output but this is number of power class

And output is n^ p

Deleted user
by Deleted user

Here.................................................................................

More Questions Like This