Advertisement
Guest User

Untitled

a guest
Jan 21st, 2016
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. int main(void)
  3. {
  4. int suma = 0, n = 0;
  5. int max;
  6.  printf("Podaj max: ");
  7.  scanf("%d",&max);
  8. while (suma < max)
  9.  {
  10.  n++;
  11.  suma = suma + 2;
  12.  }
  13.  suma = suma - n;
  14.  n--;
  15.  printf("Ilosc liczb: %d\n",n);
  16.  printf("Suma liczb: %d\n",suma);
  17. return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement