25 lines
622 B
C++
25 lines
622 B
C++
/*
|
|
AUTORE: Manuel Vichi
|
|
Esercizio 3
|
|
*/
|
|
#include <iostream>
|
|
using namespace std;
|
|
int main(void) {
|
|
unsigned int numero, esponente, potenza = 0, moltiplicazione = 0;
|
|
cout << "Inserisci un numero: ";
|
|
cin >> numero;
|
|
cout << endl;
|
|
cout << "Inserisci un esponente per la potenza di 2: ";
|
|
cin >> esponente;
|
|
cout << endl;
|
|
// Moltiplicazione: Calcolo della potenza
|
|
for (int temp = 0; temp < esponente; temp++) {
|
|
potenza = potenza + esponente;
|
|
}
|
|
for (int temp = 0; temp < potenza; temp++) {
|
|
moltiplicazione = moltiplicazione + numero;
|
|
}
|
|
cout << "Risultato Moltiplicazione: " << moltiplicazione << endl;
|
|
return 0;
|
|
}
|