Computer Science, asked by chinnibalaga007, 1 month ago

Input The first line of the input consists of two space- separated integers - num and cutoff, representing the number of candidates who have appeared for the written test (N) and representing the cutoff set by the company, respectively The second line consists of Nspace-separated integers - marks ;, marks 2 DALMI marksna list of integers representing the marks scored by the candidates in the test. write program in Java

Answers

Answered by ishaaqguru02
0

Explanation:

hebs ebeu sudndu eus su sjs subejeieje

Answered by shilpa85475
0

The second line consists of Nspace-separated integers - marks ;, marks 2 DALMI marks list of integers

Explanation:

#include<stdio.h>

void swap(int *i, int *j)

{

int temp = *i;

*i = *j;

*j = temp;

}

int seperateEvenAndOdd(int arr[], int size)

{

int left = 0;

int right = size - 1;

while(left < right)

{

while(arr[left]%2 == 0 && left < right)

{

left++;

}

while(arr[right]%2 == 1 && left < right)    

{

right--;

}  

if(left < right)

{

swap(&arr[left], &arr[right]);

left++;

right--;

}

}

}

int main()

{

int arr_size;

scanf("%d",&arr_size);

int arr[arr_size];

for(int i=0;i<arr_size;i++)

{

scanf("%d",&arr[i]);

}

int i=0;

seperateEvenAndOdd(arr,arr_size);

for(i=0;i<arr_size;i++)

printf("%d ",arr[i]);

return 0;

}

Similar questions