Home > Backend Development > C++ > body text

Bash program to find A raised to the power B?

王林
Release: 2023-08-30 21:01:06
forward
1376 people have browsed it

Bash program to find A raised to the power B?

Here we will see how to get the number A raised to the power B using a bash script. The logic is simple. We have to use the "**" operator or the power operator to do this. Let us see the following program to understand this concept clearly.

Example

#!/bin/bash
# GNU bash Script
a=5
b=6
echo "$(($a ** $b))"
Copy after login

Output

15625
Copy after login

The above is the detailed content of Bash program to find A raised to the power B?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template