**C** Programming language tutorial, Sample **C** **programs**, C++ **Programs**, Java **Program**, Interview Questions, **C** graphics programming, Data Structures, Binary Tree, Linked List, Stack, Queue, Header files, Design Patterns in Java, Triangle and Star pyramid pattern, Palindrome anagram Fibonacci **programs**, **C** puzzles.

Feb 17, 2021 · Explanation : Since we passed x and n to our function **power**, so if value of n = 0 our function will return 1, because anything **number** x with **power** zero will be 1. And **power** 0 is the last value we can get so this was our base case too. For example, if the **number** x = 5 and n = 3 then we are returning x***power** (x,n-1) implies 5***power** (5,3-1).. The **power** **of a number** can be defined as how many times the **number** is multiplied with itself. For example: 9 3 = 9 X 9 X 9 = 729 2 5 = 2 X 2 X 2 X 2 X 2 = 32 This can be written in the form x n. So, in this **program** we ask the user to input the value of x and n. Example 1: Calculating **Power** **Using** **Loop**.

2022. 7. 28. · **C program** to compute the **power of a number**: Below **C program** works only if the exponent is a positive integer. The **program** takes two integers from the user (base **number** and exponent) and calculates the **power using loop** and multiplication operator. #**include** <stdio.h>. int.