- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSquareLoop.cpp
More file actions
Latest commit
21 lines (20 loc) · 499 Bytes
/
Copy pathSquareLoop.cpp
File metadata and controls
21 lines (20 loc) · 499 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//CSC114-651
//Student: Christopher Yonek (700642859)
//Assignment: This program uses a loop to raise a number to a power.
//Date: September 2018
#include"pch.h"
#include<iostream>
usingnamespacestd;
intmain()
{
int num, bigNum, power, count=1 ;
cout << "Enter an integer: ";
cin >> num;
cout << "What power do you want it raised to? ";
cin >> power;
bigNum = num;
while (count++ < power);
bigNum *= num;
cout << "The result is: " << bigNum << endl;
return0;
}