Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

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 ajoutée par Nabil Rageh , Technical Support Manager , DenTech for communication and Information Technology
Date de publication: 2017/02/18
Ahmed Gamal Soliman
par 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

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?