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 java devoloper , Hideleco

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

And output is n^ p

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

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.