C++ Program to Find Power of a Number using for loop

 C++ Program to Find Power of a Number using for loop:



C++ Program to Find Power of a Number using for loop

Program:

1)#include<iostream>
2)using namespace std;
3)int main()
4){
5)int b,e;
6)int answer=1;
7)cout<<"enter base";
8)cin>>b;
9)cout<<"enter exponent";
10)cin>>e;
11)for(int i=1;i<=e;i++)
12)answer=answer*b;
13)cout<<"power of number"<<answer;
14)return 0; 
15)}

DESCRIPTION:

How to find power of a number in c++ using for loop?In this program we find C++ Program to Find Power of a Number using for loop.This is a program to find power of a number using loop
in c++.To find the power of number in c++ is very easy.
C++ Program to Find Power of a Number using for loop
C++ Program to Find Power of a Number using for loop
To find the power of loop in c++ is a very smell step problem.we take base and exponent from user and then we will put for loop to find power of a number using for loop.C++ Program to Find Power of a Number using for loop is very easy.you can find power of a number in c++ is very easy.


Post a Comment

0 Comments