 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 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 TechMS which is available on Google Play. Now I am going to implement the solution of this problem with the help of C programming. So first time including a header file that is stdio.h. Now I am defining main function. Inside main function, first time declaring an array, then a pointer variable for calculation of some s1 which is initialized with 0, s2 which is also initialized with 0 and then variable i. Now to receive elements from user, I have to display the message enter 10 elements on console. Now to receive the elements, I am applying a for loop which will repeat 10 times and this statement will be repeating scanf statement. So scanf will read 10 elements from the user and all the elements will be assigned inside k array. Now I am going to assign base address of array into pointer. So here you have to notice that name of array provides base address of the array. So if I write p equals to a, it means I am assigning the first address or you can say base address of array into p pointer. Now I can access all the locations of array with the help of this p pointer. So now I am going to apply another loop which will add all the even and odd elements through pointers. So now I am applying a if condition asterisk p modulus 2 w equals to 0. If this condition is true, it means the array element which is pointed through pointer is containing even value. So asterisk p is representing element of array. It is divisible by 2 if its remainder is equals to 0. So here I can write s1 equals to s1 plus asterisk p. So the value which is available at the address which is stored inside p will be added into s1. If this condition is false then s2 equals to s2 plus asterisk p. After completion of this if else condition, I have to increment p pointer so that I can point to the next location which is available inside array. So this way through this loop all the even elements will be added inside s1 and all the odd elements will be added into s2 variable. After completion of this loop, I can print the sum on console. So even sum equals to %d slash n odd sum equals to %d then s1 comma s2 and at last I am writing return 0. So this way all the even and odd elements will be added into s1 and s2 variables and you can see I have processed the array with the help of pointer. Now I am going to execute this code. I am going to enter the elements. So you can see the output even sum equals to 30 and odd sum is equals to 25. So if I add 2, 4, so 2 plus 4, 6, 6 plus 6, 12, 12 plus 8, 20 and plus 10, 30. So even sum is 30 which is correct. Now add 1, 3, 5, 7 and 9 so this will be equals to 25. So you can see both the outputs are correct. I have processed here array with the help of pointer. So if you assign base address of array into pointer then you can visit all the elements of array with the help of pointer. You just have to use asterisk p notation and you have to increase the pointer so that you can move to the next locations of the array. This way I have calculated sum of even and odd elements of array using pointer in C programming. I hope you have understood the logic well. If you want to watch more programming related videos you can follow or subscribe my YouTube channel through the URL youtube.com. You can download my programming app Techimage which is available on Google Play. Thank you for watching this video.