473,395 Members | 1,583 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

write a program using one dimensional array to display the even and odd numbers out

write a program using one dimensional array to display the even and odd numbers out of the 10 inputted integers.
Feb 15 '10 #1
6 7154
Dheeraj Joshi
1,123 Expert 1GB
Have you written any code for it...?
What problem you are getting..?
Feb 15 '10 #2
Expand|Select|Wrap|Line Numbers
  1. #include<stdio.h>
  2. #include<conio.h>
  3. void main()
  4. {
  5.     int a[10],i;
  6.         [CODE DELETED]
  7.  
  8. }
Feb 15 '10 #3
RedSon
5,000 Expert 4TB
Do not post full code solutions to homework problems. Nobody learns anything when you spoonfeed answers. You are helping them to cheat.
Feb 15 '10 #4
Expand|Select|Wrap|Line Numbers
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. void main(){
  5.  
  6. [DELETED AGAIN]
  7. }
Feb 16 '10 #5
RedSon
5,000 Expert 4TB
What part of: "Do not post full code solutions to homework problems" did you not understand?

The next person to post a full code solution to this thread will get a permanent ban.
Feb 16 '10 #6
donbock
2,426 Expert 2GB
By using one dimensional array I assume you mean that the ten numbers are passed to your function in the array. By the way, C functions can't determine the size of a passed array so it is customary to use two arguments to pass an array: the first is a pointer to the first element of the array; and the second is the number of elements in the array.

For the ten input numbers 1, 2, 3, 4, 5, 6, 7, 8 , 9 , 10 which of the following is the style of printed output you desire?

Expand|Select|Wrap|Line Numbers
  1.     1 is odd
  2.     2 is even
  3.     ...
  4.     10 is even
Expand|Select|Wrap|Line Numbers
  1.     even numbers: 2, 4, 6, 8, 10
  2.     odd numbers: 1, 3, 5, 7, 9
Feb 16 '10 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: phil goddard | last post by:
This homework tests your understanding of pointers and how to use pointers with arrays and functions. What we want to do is find the next highest int in an array based on a given float, i.e. in...
8
by: drose0927 | last post by:
Please help! I can't get my program to exit if the user hits the Escape button: When I tried exit(EXIT_SUCCESS), it wouldn't compile and gave me this error: Parse Error, expecting `'}''...
14
by: WUV999U | last post by:
Hi I am fairly familiar in C but not much. I want to know how I can write a html parser in C that only parses for the image file in the html file and display or print all the images found in...
1
by: Mohan | last post by:
Hi, In my application, I need to increase the 2-dimensional array size dynamically. Please let me know the procedure to declare a dynamic 2-dimensional array like Single dimensional array,...
2
by: Brian Worth | last post by:
I have just upgraded from VB 4.0 to VB .NET 2002. One program under VB 4.0 was able to shut down or restart the (windows XP) machine using a series of API calls. (Getlasterror, GetCurrentProcess,...
7
by: ashu | last post by:
look at code #include<stdio.h> int *mult(void); int main(void) { int *ptr,i; ptr=mult; for(i=0;i<6;i++) { printf("%d",*(ptr++));
27
by: lovecreatesbea... | last post by:
This code snippet is an exercise on allocating two dimension array dynamically. Though this one is trivial, is it a correct one? Furthermore, when I tried to make these changes to the original...
1
by: buddy | last post by:
I am having trouble writing a program that uses a one-dimensional array that reads 20 numbers each of which is between 10 and 100. As each number is read, it has to be validated and stored in the...
1
by: phpCodeHead | last post by:
I know that this sounds like something overly complex - because it is. However, if I can keep the user interface the way it is, my users will be ultra happy! That is the goal... In general, this...
8
by: desktop | last post by:
I am simulating a display that consists of 20x20 pixels. All pixels are per default white but I would like to be able to turn on some or all the pixels. My idea was to create a 3 dimensional...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.