Advertisement
Sayukoo

[KARTKOWKA]While suma<=100

Oct 11th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <string.h>
  4. int n,m,i,suma=0;
  5. int main()
  6. {
  7.     while(suma<=100)
  8.         {
  9.            
  10.             i++;
  11.                 printf("Wpisz liczbe %d",i);
  12.                 printf(" : ");
  13.                     scanf("%d", &n);
  14.                 if(n%2==0)
  15.                 suma+=n;
  16.                 printf("Suma jest rowna %d",suma);
  17.                 printf("\n");
  18.  
  19.         }
  20.  
  21.  
  22.         printf("Ilosc wszystkich liczb ktore wpisal uzytkownik",i);
  23.  
  24.  
  25.  
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement