 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can calculate some of even and odd elements of array separately by passing array into function using pointer. 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 Techimiz which is available on Google Play. Now I am going to implement the solution of this problem. So first time including a header file. Now I am declaring a function whose name is some its return type is void and it will receive an argument that will be address of array. So that's why argument type is in Asterisk which is denoting a pointer. So this statement is function declaration. Now I am defining main function here. First I have declared an array and then variable I now with the help of printf I am writing a message that is enter 10 elements. So this message will be displayed on console to receive 10 elements from user. I am applying for loop which will repeat this scan of statement to read 10 elements from user. So after completion of reading process, I can call the sum function where I am passing base address of array. So this statement is function call. Here I am just passing name of array. So any name of array represents its base address. So base address of array will be passed in some function definition automatically. Then return zero. So it is the definition of main function. Now I am going to define definition of sum function. So this block will be known as function definition. Here you can see base address of array is received inside p pointer. Now I am declaring some variables here. I then S1 and then S2. S1, S2 are initialized with zero. For logic I am applying this loop which will repeat 10 times. Now inside this loop I have to apply the logical component. So I am applying if asterisk p modulus 2 double equals to zero. So if asterisk p is divisible by 2 then the number which is stored inside array will be known as even. Otherwise it will be odd. So p is containing base address. So asterisk means dereferencing. So it will dereference the address which is available inside p pointer. So asterisk means value at address. So it will dereference the address which is available inside p pointer and the value will be available here in place of asterisk p. If it is divisible by 2 then I can add that value inside S1 variable. So I can write this statement. Here you can see asterisk p is adding into S1 variable. So asterisk p will be providing the value available at a particular address. That value will be added into S1. If this condition is false then number is odd. So it will be added into S2. So statement is S2 equals to S2 plus asterisk p. After this if else I have to increase p so that p can point to the next location of array. So every time this loop will be repeating then p will be incremented. So this process will repeat 10 times. So some numbers will be even that will be added into S1 and some numbers will be odd that will be added into S2 and p will be incremented each time so that different different locations of array can be accessed. After completion of this loop I have to print the result which is available inside S1 and S2. So for that purpose I am using printf which will display even sum equals to %d slash n odd sum equals to %d then S1 comma S2. So this way I have implemented printf statement which will display the output on console. So this is the complete program which is available in front of you. I have passed array into function and that array is managed in function definition through pointer. Now I am going to execute this code. So I am entering some even and some odd numbers in this array. So I have entered 5 times 1 and 5 times 2. So even sum is 10 and odd sum is 5. So the program is working properly. I am able to use pointers properly so that I can access all the locations of array. I hope you have understood how we can pass array into function using pointer so that we can calculate sum of even and odd elements 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 Techimus which is available on google play. Thank you for watching this video.