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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • julie ann
    New Member
    • Feb 2010
    • 1

    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.
  • Dheeraj Joshi
    Recognized Expert Top Contributor
    • Jul 2009
    • 1129

    #2
    Have you written any code for it...?
    What problem you are getting..?

    Comment

    • anurag275125
      New Member
      • Aug 2009
      • 79

      #3
      Code:
      #include<stdio.h>
      #include<conio.h>
      void main()
      {
      	int a[10],i;
              [CODE DELETED]
      
      }
      Last edited by RedSon; Feb 15 '10, 04:31 PM. Reason: Removed by weaknessforcats -- editing note by RedSon

      Comment

      • RedSon
        Recognized Expert Expert
        • Jan 2007
        • 4980

        #4
        Do not post full code solutions to homework problems. Nobody learns anything when you spoonfeed answers. You are helping them to cheat.

        Comment

        • mush1578
          New Member
          • Feb 2010
          • 15

          #5
          Code:
          #include<iostream>
          using namespace std;
          
          void main(){
          	
          [DELETED AGAIN]
          }
          Last edited by RedSon; Feb 16 '10, 08:37 PM. Reason: Removing full code

          Comment

          • RedSon
            Recognized Expert Expert
            • Jan 2007
            • 4980

            #6
            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.

            Comment

            • donbock
              Recognized Expert Top Contributor
              • Mar 2008
              • 2427

              #7
              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?

              Code:
                  1 is odd
                  2 is even
                  ...
                  10 is even
              Code:
                  even numbers: 2, 4, 6, 8, 10
                  odd numbers: 1, 3, 5, 7, 9

              Comment

              Working...