 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can count how many numbers are positive, negative and zero in 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 text rule. You can download my programming app Techimus which is available on Google Play. Now I am going to implement solution of this problem. So first I am including a header file that is stdi.h. Now I am declaring a function whose name is count. It will receive an argument that will be an address of array. Its written type is void. So this statement is function declaration. After this function declaration, I am defining main function definition. So here I am declaring two variables an array and variable i. Now with the help of printf, I am going to display the message enter 10 numbers on console. Now this for loop will repeat 10 times to receive 10 elements from user and all the elements will be received through scanf and they will be stored inside array a. Now I am calling count function and I have passed a array inside it. So this statement is function calling. Here you can see I am passing name of array in form of base address. So whenever we pass name of array into a function call, it automatically pass its base address into the function definition. At last return zero. So this is the definition of main. Now I have to define count function definition. So this block is function definition. Here you can see p pointer is declared which will receive base address of array a. So with the help of this p pointer, I can access all the locations of array. So first I am declaring some variables here. C1, C2, C3. These are initialized with zero. Now I am implementing for loop which will repeat 10 times. Inside this for loop, I have to apply conditions for checking positive, negative and zero. So this is first condition. See it carefully. Here asterisk p is written. So p is having base address of array and asterisk means value at address. So this asterisk will find out the value which is available on that base address and it will be compared with zero. So if it is greater than zero, then C1 will be incremented by one. If this condition is false, then asterisk p will be compared with zero. So if this condition is true, C2 will be incremented. Otherwise C3 will be incremented. So this way I have checked whether the element which is available at an address is positive, negative or zero. After comparing base location, I have to increase the pointer by one. So using this p plus plus pointer will be pointing to the second location of array and then again asterisk p will be dereferencing that location so that it can find out the value available on that address and it will be compared with zero, whether it is greater than zero, less than zero or equals to zero. So accordingly C1, C2 or C3 will be incremented. So this process will repeat 10 times after completion of loop. The result will be available inside C1, C2, C3. So these results can be displayed on console with the help of printf. So positive count will be displayed, then negative count will be displayed and then zero count will be displayed and then C1, C2 and C3. These variables are displayed with the help of this printf. So this way I have implemented the complete logic in front of you. Now I am executing this code. It is asking for 10 numbers. So I am entering different numbers. Some are positive, some are negative and some are zero. So you can see the output. Positive are four, negative are three and zero are three. So if you look at the input, so here one, six, eight and five, four positive numbers are available, zero is available three times and negative elements minus five, minus seven, minus seven, these are available three times. So the output is correct. Program is working properly. It is properly counting how many positive negative and zero elements are available in array and I have passed array into function with the help of pointer. So this way I have implemented the logic in front of you. I hope you have understood it well. 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.