SHARE
TWEET

Ejercicio 12.3

seergiomv Dec 9th, 2019 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. suma(int n){
  3.     int sum = 0;
  4.     for (int i = 1; i <= n; i++){
  5.         sum = sum+i;
  6.     } printf("%d",sum);
  7. }
  8. int main(){
  9.     int n,sum;
  10.     printf("Dame n: ");
  11.     scanf("%d",&n);
  12.     suma(n);
  13. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top