From 8219e124a7ccd9b01cb2932a0c7f4ec4318e4c46 Mon Sep 17 00:00:00 2001 From: Mann Mehta <44433995+mann2108@users.noreply.github.com> Date: Sat, 4 Apr 2020 18:16:40 +0530 Subject: [PATCH] Resolve typo errors --- math/binary_exponent.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/math/binary_exponent.cpp b/math/binary_exponent.cpp index 808a36ce8..b4551da25 100644 --- a/math/binary_exponent.cpp +++ b/math/binary_exponent.cpp @@ -31,7 +31,7 @@ int binExpo(int a, int b) { /// Iterative function to calculate exponent in O(log(n)) using binary exponent. int binExpo_alt(int a, int b) { int res = 1; - while (b>0) { + while (b > 0) { if (b%2) { res = res*a; } @@ -45,9 +45,9 @@ int main() { int a, b; /// Give two numbers a, b std::cin >> a >> b; - if (a==0 && b==0) { + if (a == 0 && b == 0) { std::cout << "Math error" << std::endl; - } else if (b<0) { + } else if (b < 0) { std::cout << "Exponent must be positive !!" << std::endl; } else { int resRecurse = binExpo(a, b);