C Program to find the sum of the elements of a 2-D array. In this example, we will find the sum of the elements of a 2-D array allowing the user to enter the row size and column size according to their requiremnts. Here in the output we have entered a row size 3 and column size 3. PROGRAM #include <stdio.h> #include <conio.h> void main () { int a [ 50 ][ 50 ], r , c , i , j , sum = 0 ; printf ( "Enter the row size and column size of the array :" ); scanf ( " %d%d " ,& r ,& c ); printf ( "Enter the elements of the array : " ); for ( i = 0 ; i < r ; i ++) { for ( j = 0 ; j < c ; j ++) ...
Comments