Write a function that removes all even numbers from an array
Solution
ANSWER TO FIRST QUESTION
#include<iostream.h>
 #include<conio.h>
 int* removeEvens(int *a,int length, int *oddsFound)
{
      int *odd_arr;
      odd_arr=new int[*oddsFound];
      int c=0;
      for(int i=0;i<length;i++)
      {
    if(a[i]%2!=0)
    {
        odd_arr[c]=a[i];
        c++;
    }
      }
      return odd_arr;
}
 void main()
 {
    int odd=0;
    int a[50];
    int n;
    int *p;
    clrscr();
   cout<<\"enter the number of elements\"<<endl;
    cin >> n;
    for(int i=0;i<n;i++)
    cin >> a[i];
   for(int j=0;j<n;j++)
    {
        if(a[j]%2!=0)
        {
            odd=odd+1;
        }
    }
p=removeEvens(a,n,&odd);
       cout<<\"the content of odd array are\"<<endl;
        for(int k=0;k<odd;k++)
        cout<<\"\ \"<<p[k];
getch();
}
ANSWER TO THE SECOND QUESTION
option c is the answer. 10 8 10 8 10 will be the contents of the array. after executing that code.
answer to third question
option d is not the valid function call.


