fork download
  1. #include<stdio.h>
  2.  
  3.  
  4. int main(void)
  5. {
  6. int j, sum=0;
  7. long int product=1;
  8.  
  9. for(j=1;j<=30;j=j+2)
  10. {
  11. sum=sum+j;
  12. }
  13. for(j=2;j<=30;j=j+2)
  14. {
  15. product=product*j;
  16. }
  17.  
  18. printf("The sum of positive odd numbers is: %d\n", sum);
  19. printf("The product of positive even numbers is: %ld",product);
  20.  
  21. }
Runtime error #stdin #stdout 0s 1788KB
stdin
Standard input is empty
stdout
The sum of positive odd numbers is: 225
The product of positive even numbers is: -1409286144