Advertisement
Guest User

Esponente

a guest
Oct 31st, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. #include <stdio.h>
  2. int main(void)
  3. {
  4. double i, j, n, x;
  5. printf("Questo programma esegue le operazioni esponenziali\n");
  6. printf("(Solo numeri interi non troppo grandi!)\n");
  7. printf("Scrivi un numero: ");
  8. scanf("%lf", &i);
  9. printf("Scrivi l'esponente: ");
  10. scanf("%lf", &n);
  11. j = 1;
  12. x = i;
  13. while (j<n) {
  14. i =x*i;
  15. j++;
  16. }
  17. printf("Il risultato è %.0lf\n", i);
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement