0

Write a C function to find the kth occurrence of an even integer in a sequence of non negative integers, and then call your func

Write a C function to find the kth occurrence of an even integer in a sequence of non negative integers, and then call your function from main. I am not getting it to write the program using function. can any1 pls help me to write the program using functions? thanks a lot. John Wells Your function should be according to the following declaration: int find_even(int k). Input You are given the input in two lines: The first line contains a positive integer k In the second line, you will be given a sequence of numbers You have to find the kth occurrence of n in the sequence below The second line consists of a sequence of non-negative integers terminated with a -1. The -1 is not part of the sequence Output If there are k even numbers in the sequence, then output the kth Occurrence of even nos in the sequence Otherwise output a -1 Sample Input 2 1 1 3 2 3 4 -1 Sample Output 4 https://code.sololearn.com/cGCm35d4Bcz1/?ref=app

19th Sep 2018, 5:04 PM
Nilutpol Kashyap
Nilutpol Kashyap - avatar
3 Respuestas
19th Sep 2018, 7:04 PM
John Wells
John Wells - avatar
0
Please could you send result of it
15th Feb 2023, 4:14 PM
Krish
- 2
Write a C function to find the kth occurrence of an even integer in a sequence of non-negative integers, and then call your function from main. Your function should be according to the following declaration: int find_even(int k); Input You are given the input in two lines: The first line contains a positive integer k. In the second line, you will be given a sequence of numbers. You have to find the kth occurrence of n in the sequence below. The second line consists of a sequence of non-negative integers, terminated with a -1. The -1 is not part of the sequence. Output If there are k even numbers in the sequence, then output the kth occurrence of even in the sequence. Otherwise, output a -1.
12th Aug 2019, 1:53 PM
Ketha Baby Sushmitha
Ketha Baby Sushmitha - avatar