replace printf & scanf with std::cout and std::cin

This commit is contained in:
Krishna Vedala
2020-05-28 16:41:07 -04:00
parent e52da1db6e
commit c559ebcedb

View File

@@ -81,10 +81,10 @@ void power(int x, int n) {
/** Main function */
int main() {
int exponent, base;
printf("Enter base ");
scanf("%id \n", &base);
printf("Enter exponent ");
scanf("%id", &exponent);
std::cout << "Enter base ";
std::cin >> base;
std::cout << "Enter exponent ";
std::cin >> exponent;
power(base, exponent);
return 0;
}