Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

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 added by هاشم المشارقة , Key Account Manager , Advanced United Systems Ltd. ( A member of Taj Holding Group)
Date Posted: 2016/01/16

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

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

the function will return value of result =0

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

It will return0 .Because result initial value is zero.

Reshma Gomez
by 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

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