 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can print some of the elements which are available at even and odd indexes of array by passing array into function. Before starting, you can note my information. You can follow or subscribe my YouTube channel through the URL youtube.com slash sanjaygupta underscore tech school. You can download my programming app TechMS which is available on Google Play. Now here I am going to implement a program in C in front of you which will add all the elements which are available at even and odd indexes separately and I have to pass that 1D array into function. So I am implementing function declaration first. So this is function declaration return type of function is void and it is receiving one argument of integer type and that is array. Name of function is some then main inside main function. I am going to declare an array whose size is 10 and then I variable then printf will display the masses enter 10 elements on console. Now I am implementing a for loop which will repeat 10 times and it will receive the entered elements with the help of scanf inside a array. Now I am going to call some function and I am passing array a inside it. So this is function calling after function calling return zero statement is available. Now I am going to implement definition of some function. So this block will be containing function definition. Here you can see I have used return type of some function as void. Why so? Because some function is calculating two sums one for even and one for odd indexes. So a function can return only one value to the main function. If we want to return multiple values then it is not possible for that purpose. We have to use the concept of call by address. So right now I have used the return type of some function as void and I will be printing the result inside this sum function definition. So here I am declaring three variables I S1 and S2. S1 and S2 are initialized with zero. Then I am implementing a for loop inside this for loop. I have to implement the logic. So I have to check the index which is represented with I. So if I is divisible by two then its remainder will be zero. So it will be if I is divisible by two then it is pointing to even index. So for that I am using this notation S1 equals to S1 plus A of I. If I is not divisible by two then it is pointing to odd index. So those values will be added into S2. So this way I have implemented the for loop which is calculating sum of elements which are available at even indexes into S1 and the sum of elements which are available at odd indexes is calculated into S2. Now after completion of for loop I am printing results on console with the help of this printf statement. So even sum equals to %d slash an odd sum equals to %d then S1 comma S2. With this statement values of S1 and S2 will be displayed on console. So this way I have implemented the complete code in front of you. Now I am going to execute this code. You can see it is asking for 10 numbers. So I am entering 1, 2, 1, 2, 1, 2, 1, 2. You can see all even indexes are containing one and odd indexes are containing two. So even sum is 5 and odd sum is 10. So here elements which are available at even indexes are added separately and the elements which are available at odd indexes are added separately. So that's why even sum is 5 and odd sum is 10. So I hope you have understood this concept how we can pass an array into function and we can calculate sum of elements which are available at even and odd indexes of array separately. If you want to watch more programming related videos you can follow or subscribe my youtube channel through the url youtube.com slash sanjaygupta underscore tech school. You can download my programming app TechMS which is available on google play. Thank you for watching this video.