#include<stdio.h>
#include<conio.h>
void main()
{
int n, a[10, evensum=0, oddsum=0, i;
printf("\n Enter the number of values");
scanf("\n %d", &n);
printf("\n Enter %d number of values", n);
for(i=0; i<n; i++)
scanf("\n %d", &a[i]);
while(i<n)
{
if(a[i]%2==0)
evensum=evensum + a[i];
else
oddsum=oddsum + a[i];
}
printf("\n Odd sum = %d", oddsum);
printf("\n Even sum = %d", evensum);
getch();
}
Hopefully, is that correct, anyone out there.... I am a beginner and this is my homework, please help me correct the mistaks if you know them...
for(int i = 1; i < 100; i+=2) { System.out.println(i); }
The procedure is the same whether the number is even or odd. There is no separate procedure for odd numbers.
The answer is an odd number.
you cross the numbers out from back to front
To find five odd numbers that add up to 14, we can use the combination of negative odd numbers and positive odd numbers. One possible solution is -3, -1, 1, 5, and 12. However, since 12 is not an odd number, we can't reach 14 with only positive odd numbers. Thus, it is impossible to find five odd integers that sum to an even number like 14.
for(int i = 1; i < 100; i+=2) { System.out.println(i); }
To find the median of an array of numbers, first, arrange the numbers in ascending order. If the array has an odd number of elements, the median is the middle number. If the array has an even number of elements, the median is the average of the two middle numbers.
To separate odd and even numbers from an array of 10 numbers in the 8085 microprocessor, you can utilize a loop and the AND instruction. First, load each number from the array into a register and perform a bitwise AND operation with the value 1. If the result is 0, the number is even; if the result is 1, the number is odd. You can then store the odd numbers in one memory location and the even numbers in another, iterating through the entire array until all numbers are processed.
void f (int* a, int len) { if (!a) return;for (int i=0; i<len; ++i) { if (a[i]%2) { printf ("%d is odd\n", a[i]); } else { printf ("%d is even\n", a[i]); } }
Reference: cprogramming-bd.com/c_page4.aspx#ODD%20 Numbers
int array[10] = {...}; for (int i = 0; i < 10; ++i) { if (i % 2 == 0) array[i] += 5; else array[i] -= 10; }
The procedure is the same whether the number is even or odd. There is no separate procedure for odd numbers.
All nonzero numbers have factors. Some factors are odd numbers. 3 is an odd factor of 12.
Look for odd squares. Multiplying odd numbers results in an odd product.
#include
The answer is an odd number.
Shell problems are programs that can be run to find out information about numbers. The problem can help find an even or odd number, or what the sum of a cube is.