C++
xxxxxxxxxx
using namespace std;
int calculatePower(int, int);
int main()
{
int base, powerRaised, result;
cout << "Enter base number: ";
cin >> base;
cout << "Enter power number(positive integer): ";
cin >> powerRaised;
result = calculatePower(base, powerRaised);
cout << base << "^" << powerRaised << " = " << result;
return 0;
}
int calculatePower(int base, int powerRaised)
{
if (powerRaised != 0)
return (base*calculatePower(base, powerRaised-1));
else
return 1;
}
Enter base number: 3 Enter power number(positive integer): 4 3^4 = 81
Linux - anc-api-tools qanday o'rnatiladi
Linux - curvedns qanday o'rnatiladi
Python - Raqamning ijobiy, salbiy yoki 0 ekanligini tekshiring
Linux - zenmap qanday o'rnatiladi
C - Butun sondagi raqamlar sonini sanash
C++ - Kabisa yilini tekshiring
JavaScript - Satr ma'lum belgilar bilan boshlanishi va tugashini tekshiring
C++ - Raqam tub yoki oddiy emasligini tekshiring
C - Dinamik xotira ajratish yordamida eng katta raqamni toping
Kotlin - Raqamni n o‘nlik kasrgacha yaxlitlash
Linux - xbitmaps qanday o'rnatiladi
Linux - zstd qanday o'rnatiladi
Kotlin - Raqamni teskari aylantirish
Python - Excel (XLSX) fayllarini yozish
Java - Raqamni teskari aylantirish
C++ - Qism va qoldiqni toping
Java - Piramida va naqsh yarating
Linux - zfs-test qanday o'rnatiladi
We have been online since 2021 and 1 millions of people around the globe have visited our website since then
More visitors every month