Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { Visit: http://g-lts.info/ for more code! }
- #include <stdio.h>
- #include <math.h> /* για να μπορέσουμε να χρησιμοποιήσουμε την συνάρτηση pow() */
- int main (void)
- {
- long int n,i,t;
- t=0;
- printf("Δώσε έναν ακέραιο : ");
- scanf("%ld",&n);
- for (i=1; i<=n; i++)
- t += pow(i,2); /* pow(βάση, εκθέτης); */
- printf ("N = %ld\n",t);
- return 0;
- }
- { Visit: http://g-lts.info/ for more code! }
Advertisement
Add Comment
Please, Sign In to add comment