seergiomv

Ejercicio 12.3

Dec 9th, 2019
104
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