Getting wrong answer in my question

I am trying to find out the length of an string using strlen() but it seems to not working properly my code is below with the input i given

#include 
using namespace std;

int main()
{
    long long T,a,b,c,e;
    scanf("%lld",T);
    long long M[T];
    for(a=1;a<=T;a++)
    {
    	scanf("%lld",&M[a]);
    	c=M[a];
    	long long l[c],d[c],r[c];
    	for(b=1;b<=c;b++)
    	{
    		scanf("%lld%lld",&l[b],&d[b]);
    		r[b]=l[b]*d[a];
    		e=strlen(r);
    		printf("%d",e);
    	}
    }
    return 0;
}

Input
1
1
100 100

Can you tell me where i am going wrong?

Two mistakes I note in your code are,

  1. You are declaring an array M of size ‘T’, so since array is 0-indexed, there is no M[T] element that you can access. Similar thing for l,d and r.
  2. strlen() function is supposed to be used on a char array(String), you cannnot use it on integer array, or on a particular element of integer array.

Hope this helps you!

Thanks for your suggestion

scanf("%lld",T)
should be

scanf("%lld",&T)