Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<conio.h>
  4.  
  5. int main()
  6. {
  7.    
  8.     int c,b,sucet=0;
  9.    
  10.    
  11.     c = getch();
  12.    
  13. while(1)
  14.    
  15. {
  16.     if(c == 27)
  17.          {
  18.          printf("Ukoncil si zadavanie\n");
  19.          break;
  20.          }
  21.     else
  22.     {
  23.         printf("Zadaj cislo postupnosti \n");
  24.         scanf("%d", &b);
  25.         sucet += b;
  26.         c = getch();
  27.                
  28.                          
  29.         }
  30. }
  31. printf("Vysledok je; %d\n", sucet);
  32.  
  33. getch();
  34. return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement