Advertisement
Guest User

Untitled

a guest
Nov 1st, 2011
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.47 KB | None | 0 0
  1.  
  2. #include<stdio.h>
  3.  
  4. int main(void){
  5.  
  6. int c,p,g,i;
  7. p = 0;
  8. i = 0;
  9. while (1){ //itt nem tudom hogy addig folytassa mig 0 at nem adunk meg
  10.  
  11. printf ("zadaj kladne cislo\n");
  12. scanf ("%d",&c);
  13. p = p + c;
  14. ++i; // atlag szamitasnal lessz segitsegul
  15. if (c<0){
  16. printf("\nje to zaporne cislo!\n\n");
  17. }
  18. }
  19.  
  20. g = p/i;
  21. printf("az atlag ertek: %8.0d",g); // itt nem tudom hogyan kerekitsen a program es folytatni hogy primszamokat es az oszthatosagot kiirja
  22. printf();
  23.  
  24.  
  25.  
  26.  
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement