Communiquez avec les autres et partagez vos connaissances professionnelles

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

Suivre

What does this function do exactly ? int power(int x, int y){ int result=0; for(int i=1; i<=y; i++) result *= x; return result; }

user-image
Question ajoutée par هاشم المشارقة , Key Account Manager , Advanced United Systems Ltd. ( A member of Taj Holding Group)
Date de publication: 2016/01/16
Utilisateur supprimé
par Utilisateur supprimé

Result in this case will be0 as the initialized value of Result is0

Shenjith  Murali
par Shenjith Murali , Software Engineer , FACTS COMPUTER SOFTWARE HOUSE

the function will return value of result =0

Julfkar  Moh Umar
par Julfkar Moh Umar , Sr. Software Engineer , Aakash Edutech Private Limited

It will return0 .Because result initial value is zero.

Reshma Gomez
par Reshma Gomez , Senior Analyst , Accenture India LTD

The function does finding the yth power of x.However since the result is initialized to zero the value will be zero always.

result=0

because result initial value is 0

More Questions Like This