int m, n, pow;
cout <<"Enter m and n: ";
cin >> m >> n;
pow =1;for(int i=1; i<=n; i++)
pow = pow * m;
cout << m <<"^"<< n <<" = "<< pow << endl;return0;}
int m, n, pow;
cout <<"Enter m and n: ";
cin >> m >> n;
pow =1;for(int i=1; i<=n; i++)
pow = pow * m;
cout << m <<"^"<< n <<" = "<< pow << endl;return0;}
I dont get how this is working :((
ty!
Run through it in your head. If n = 4 and m = 2, then in your for loop you have:
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.