 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can calculate some of positive and negative elements of array 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 TechMS which is available on Google Play. Now I am going to implement solution of this problem. So first time including a header file that is STDI dot h. Now I am going to declare a function whose name is some its written type is void and it will receive an argument that will be base address of array. So that base address will be stored inside a pointer. That's why argument type is in as to risk that means integer pointer. So this statement is function declaration. Now I am defining main function inside main function. I am declaring an array and variable I now with the help of printf. I am going to display the message and 10 elements on console to read all the elements. I am applying a for loop and then with the help of scanf all the elements will be stored inside the array. Now I have to call some function where I am passing base address of array by passing its name. So this statement is function calling and after calling statement I am writing return zero. So this is the complete definition of main function. Now I have to define definition of some. So here I have to receive base address into a pointer. That's why I have used in as to risk P. So P pointer will be receiving base address of array and this block will be known as function definition inside this function. I am declaring some variables. So variable I then S1 S2 these two variables are initialized with zero. Now with the help of for loop I am going to apply a process where I have to check whether the element of array is positive or negative. So for that purpose I am using if asterisk P greater than zero. So here you have to understand that P is containing base address of array. So asterisk means value at address. So P is for pointing to a particular address. So this asterisk will provide the value which is available on that address. So if that value is greater than zero, I can apply S1 equals to S1 plus asterisk P. So that value will be added into S1 else if asterisk P less than zero. So if value at that address will be less than zero, then I can add it into S2 variable. So this way I have applied the logic after condition checking. I have to move to the next location of array. So for that purpose I am using P plus plus. So through P plus plus I will be moving to the next location of array. So this loop will repeat 10 times if else will be checked and 10 times P plus plus will be performed. After completion of this loop, I can use printf which will display positive sum and negative sum. So this way positive sum and negative sum will be displayed on console. So this is the complete implementation of the program. Here array is passed into function using pointer. Now I am going to execute this code. So you can see I am I am entering some positive and some negative elements. So five times I have entered positive one and five times I have entered negative one. So the result is positive sum five and negative sum minus five program is working properly. So I hope you have understood how we can pass array into function using pointer for calculating sum of positive and negative 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.