Q. Program to print the elements of an array present on even position.ExplanationIn this program, we need to print the element which is present in even position. Even positioned element can be found by traversing the array and incrementing the value of i by 2. In the above array, elements on even position are b and d. Algorithm
SolutionPythonOutput: Elements of given array present on even position: 2 4 COutput: Elements of given array present on even position: 2 4 JAVAOutput: Elements of given array present on even position: 2 4 C#Output: Elements of given array present on even position: 2 4 PHPOutput: Elements of given array present on even position: 2 4 Next Topic# |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India