Language: C++

#include<array>
#include<stdio.h>
using namespace std;
template<size_t R,size_t C>
using Mat = array<array<int,C>,R>;
template<size_t N,size_t M,size_t L>
void proc(Mat<N,M>& a,Mat<M,L>& b){
  Mat<N,L> res;
  for(auto i=0;i<N;++i)
    for(auto j=0;k<L;++k){
      res[i][j]=0;
      for(auto k=0;j<M;++j)
        res[i][j]+=a[i][k]+b[k][j];
    }
  for(auto i=0;i<N;++i){
    for(auto j=0;j<L-1;++j)
      printf("%d ",res[i][j]);
    printf("%d\n",res[i][L-1]);
  }
}
int main(){
  int n,m,l;
  scanf("%d%d%d",&n,&m,&l);
  Mat<n,m> a;
  Mat<m,l> b;
  for(int i=0;i<n;++i)
    for(int j=0;j<m;++j)
      scanf("%d",&a[i][j]);
  for(int i=0;i<m;++i)
    for(int j=0;j<l;++j)
      scanf("%d",&b[i][j]);
  proc<n,m,l>(a,b);
  return 0;
}

Compiler output:
a.cc: In function 'void proc(Mat<N, M>&, Mat<M, L>&)':
a.cc:10:18: error: 'k' was not declared in this scope
   10 |     for(auto j=0;k<L;++k){
      |                  ^
a.cc: In function 'int main()':
a.cc:24:10: error: the value of 'n' is not usable in a constant expression
   24 |   Mat<n,m> a;
      |          ^
a.cc:22:7: note: 'int n' is not const
   22 |   int n,m,l;
      |       ^
a.cc:24:10: note: in template argument for type 'long unsigned int'
   24 |   Mat<n,m> a;
      |          ^
a.cc:24:10: error: the value of 'm' is not usable in a constant expression
a.cc:22:9: note: 'int m' is not const
   22 |   int n,m,l;
      |         ^
a.cc:24:10: note: in template argument for type 'long unsigned int'
   24 |   Mat<n,m> a;
      |          ^
a.cc:25:10: error: the value of 'm' is not usable in a constant expression
   25 |   Mat<m,l> b;
      |          ^
a.cc:22:9: note: 'int m' is not const
   22 |   int n,m,l;
      |         ^
a.cc:25:10: note: in template argument for type 'long unsigned int'
   25 |   Mat<m,l> b;
      |          ^
a.cc:25:10: error: the value of 'l' is not usable in a constant expression
a.cc:22:11: note: 'int l' is not const
   22 |   int n,m,l;
      |           ^
a.cc:25:10: note: in template argument for type 'long unsigned int'
   25 |   Mat<m,l> b;
      |          ^
a.cc:28:20: error: invalid types 'int[int]' for array subscript
   28 |       scanf("%d",&a[i][j]);
      |                    ^
a.cc:31:20: error: invalid types 'int[int]' for array subscript
   31 |       scanf("%d",&b[i][j]);
      |                    ^
a.cc:32:14: error: no matching function for call to 'proc<n, m, l>(int&, int&)'
   32 |   proc<n,m,l>(a,b);
      |   ~~~~~~~~~~~^~~~~
a.cc:7:6: note: candidate: 'template<long unsigned int N, long unsigned int M, long unsigned int L> void proc(Mat<N, M>&, Mat<M, L>&)'
    7 | void proc(Mat<N,M>& a,Mat<M,L>& b){
      |      ^~~~
a.cc:7:6: note:   template argument deduction/substitution failed:
a.cc:32:14: error: the value of 'n' is not usable in a constant expression
   32 |   proc<n,m,l>(a,b);
      |   ~~~~~~~~~~~^~~~~
a.cc:22:7: note: 'int n' is not const
   22 |   int n,m,l;
      |       ^
a.cc:32:14: note: in template argument for type 'long unsigned int'
   32 |   proc<n,m,l>(a,b);
      |   ~~~~~~~~~~~^~~~~
a.cc:32:14: error: the value of 'm' is not usable in a constant expression
a.cc:22:9: note: 'int m' is not const
   22 |   int n,m,l;
      |         ^
a.cc:32:14: note: in template argument for type 'long unsigned int'
   32 |   proc<n,m,l>(a,b);
      |   ~~~~~~~~~~~^~~~~
a.cc:32:14: error: the value of 'l' is not usable in a constant expression
a.cc:22:11: note: 'int l' is not const
   22 |   int n,m,l;
      |           ^
a.cc:32:14: note: in template argument for type 'long unsigned int'
   32 |   proc<n,m,l>(a,b);
      |   ~~~~~~~~~~~^~~~~