Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int array[100], i, num, sumOdd;
- printf("Enter the numbers \n");
- scanf("%d", &num);
- for (i = 0; i < num; i++)
- {
- scanf("%d", &array[i]);
- }
- for (i = 0; i < num; i++)
- {
- if (array[i] % 2 == 0)
- {
- printf("Even numbers are %d\n", array[i]);
- }
- }
- for (i = 0; i < num; i++)
- {
- if (array[i] % 2 != 0)
- num += i;
- {
- printf("The sum of odd numbers is %d.\n", sumOdd);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement