I had no problem doing this quiz.

1.

#include <iostream>
#include <math.h>
using namespace std;

long superpower (long a, long b){
return pow(a,b);
}
int main (){
long a, b;
cout << “Introduce un numero (base)n”;
cin >>a;
cout << “Introduce otro numero (potencia)n”;
cin >> b;
cout << “Tu resultado es = ” << superpower (a,b) << endl;
return 0;
}

2.

#include <iostream>
using namespace std;

void stars (int x){
for (int i=0; i<x; i++){
cout << “*”;}
}

int main (){
int x;
cout << “Introduce un numero de estrellas que quieres vern”;
cin >> x;
stars (x);

cout << endl;
return 0;
}

9642181065_5eb55b9779_m

http://www.alexmatravers.co.uk/

CC BY 4.0 Quiz #6 by alan46bc is licensed under a Creative Commons Attribution 4.0 International License.