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
How can I swap two values without using a temporary?
Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?
Explain how can I open a file so that other programs can update it at the same time?
How can I copy just a portion of a string?
Why is c still so popular?
Does free set pointer to null?
What is the difference between a string and an array?
Is it possible to have a function as a parameter in another function?
exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above
#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }
What do you know about the use of bit field?
How can I implement a delay, or time a users response, with sub-second resolution?
What is the difference between malloc() and calloc() function in c language?
What is operator promotion?
Why static variable is used in c?