please can some one guide me, to the answer
Write a C program to enter 15 numbers as an input from the
keyboard and program will find and print odd numbers and
their average.
i have studied
while and do while loop
for loop
if and else if
switch
Answer Posted / lalabs
// more simple and faster
if( numbers[i] & 1)
{
printf("Odd number: %d\n", numbers[i]);
sum += numbers[i]; // sum the numbers
count++; // count the odd numbers
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
can anyone please tell about the nested interrupts?
what will be maximum number of comparisons when number of elements are given?
What is pass by reference in functions?
count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array
Is null valid for pointers to functions?
What is the benefit of using #define to declare a constant?
What is the benefit of using const for declaring constants?
Do array subscripts always start with zero?
When should a type cast be used?
Why doesnt that code work?
In C programming, what command or code can be used to determine if a number of odd or even?
State two uses of pointers in C?
Explain what are the different file extensions involved when programming in c?
How many main () function we can have in a project?
the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters