 अलो फ्रेंट्स आम संजे गुप्ता इस वीडियो आम गों तो देमून्स्तेट यूँ हूँ यूँ कैं फाँन्डाउ सम्वोग एवन अड एलिमट्स सब रेट्ली अप वे मेट्रिक्स भी पास्टिं तूडी आरे लिंट्वोग फुंक्षन बहुश्ताँ यूँँँँँ तूडी ऑधंणियो औब लग्डियो औड अप लग्डियो मूँँँँँँँँँँ makeção दरफ सन्संे लि़ा और दोनबढ़ Бог़ का आपके लिआ after that i am defining main function inside main function first i am declaring a 2d array then ij variables now with the help of printf the masses enter elements will be displayed on console to receive elements from user i am implementing nested loops so first loop is i which will provide row indexes and second loop is j which will provide column indexes now i am repeating scanner statement with these nested loops so that elements of 2d array can be stored at different indexes after completion of reading process i can call some function and i am passing 2d array inside it so this statement is function calling and then return 0 so return type of sum function is void that's why it will not receive any argument from the function definition so after implementation of main function i am defining definition of sum function so this block will be known as function definition inside this function i am declaring some variables so here s1 and s2 variables are initialized with 0 now again i am implementing nested loops so that i can access elements available at different indexes so i will be providing row indexes and j will be providing column indexes now i am applying if condition here i am checking whether array element which is available at aij position is divisible by 2 or not so if array element is divisible by 2 then it is even element otherwise it is odd element so i am applying this notation s1 equals to s1 plus aij so aij element will be added into s1 if it is even now else if it is odd then it will be added into s2 so this is the complete implementation of this nested loop again you can see if aij is divisible by 2 then aij will be added into s1 otherwise it will be added into s2 after completion of these nested loops we can print the sum on console with the help of this printf so even sum equals to percent d then slash n odd sum equals to percent d then s1 comma s2 so this way complete definition of sum function is implemented in front of you now i am going to execute this program so that we can check the output so you can see i have entered nine elements so now count how many elements are even so two two two only three times i have entered even value so even sum is six now odd elements are one one one one one one so six times i have entered one so odd sum is six so the program is working properly it is showing the correct results so this way i have passed a 2d array into function so that i can find out sum of even and odd elements separately i hope you have understood how i have implemented this code if you want to watch more programming related videos you can follow or subscribe my youtube channel through the url youtube.com slash sanjay gupta underscore tax school you can download my programming app techemist that is available on google play thank you for watching this video