Home > Backend Development > C++ > Bash program to find A raised to the power B?

Bash program to find A raised to the power B?

王林
Release: 2023-08-30 21:01:06
forward
1564 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:
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
Latest Issues
debian - bash configuration for new linux users
From 1970-01-01 08:00:00
0
0
0
git bash crashes
From 1970-01-01 08:00:00
0
0
0
python3.x - How does git bash run .bat files?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template