5/5 – (1 vote)
Write an interactive C program that prompts for and reads a 2D-array Of size 3 * 5 rowise, it then calls a function getRowNum that prompts for and reads a row number and then it returns that row number, say n, if it is a valid for the array; otherwise it loops until the user enters a valid row number.
The main function then passes the returned row number n and the 2D-array to a function distinctRowElements that returns a ID-array which contains the distinct elements Of row n Of the 2D-array together with the number of distinct elements in that row. The main function finally displays the returned array of distinct elements.
Your program must use appropriate loops.
The array reading must be done in the main and not in another function.