while(n != 0) { if (n > 0) { sum = sum + n; i++; } scanf("%d", &n); } printf("sum=%d\ncount=%d\n", sum, i);