Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- void myFunct()
- {
- int i,sum=0,pr=1,n,x;
- scanf("%d",n);
- for(i=1;i<=n;i++)
- {
- scanf("%d",&x);
- if(i%2==0)
- {
- sum+=x;
- }
- else{pr*=x;}
- }
- printf("The sum of even numbers is :%d\n The mutiple of odd numbers is %d\n",sum,pr);
- }
- int main()
- {
- printf("Enter the number of numbers:");
- myFunct();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement