Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. void myFunct()
  4. {
  5. int i,sum=0,pr=1,n,x;
  6. scanf("%d",n);
  7. for(i=1;i<=n;i++)
  8. {
  9. scanf("%d",&x);
  10. if(i%2==0)
  11. {
  12. sum+=x;
  13. }
  14. else{pr*=x;}
  15. }
  16. printf("The sum of even numbers is :%d\n The mutiple of odd numbers is %d\n",sum,pr);
  17. }
  18. int main()
  19. {
  20.  
  21. printf("Enter the number of numbers:");
  22. myFunct();
  23.  
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement