Saturday 27 August 2016

Power Finding Program

www.programmingcalculator.com
https://nikhilnihal.github.io/programmingcalculator/index.html

C++ PROGRAM FOR FINDING POWER

#include <bits/stdc++.h>
using namespace std;

int main() {
    int exp;
    float base, power = 1;

    cin >> base >> exp;

    while (exp != 0) {
        power *= base;
        --exp;
    }

    cout << "Result = " << power;
    
    return 0;
}

No comments:

Post a Comment

Uploading and Running Lambda function in AWS

Main.go package main import ( "fmt" "encoding/json" "log" "github.com/aws/aws-lambda-g...