Advertisement
Guest User

Untitled

a guest
Jan 17th, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <conio.h>
  3. #include <stdlib.h>
  4.  
  5. int x = 0;
  6. int i = 0;
  7.  
  8. int ES(int x, int y)
  9. {
  10.     x += y; //Działania += -= czy *= to skrót dla x=x+y / x=x-y / x=x*y;
  11.            
  12. return x;   //
  13. }
  14.  
  15.  
  16.  
  17. void main()
  18. {
  19.     int n,s;
  20.  
  21.     printf("Podaj ilosc liczb: \n");
  22.     scanf("%d" , &n);
  23.  
  24.     for(i=1;i<=n;i++)
  25.         printf("%d\n" , i);
  26.         printf("Suma wynosi %d",ES(s,i));
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement