Error is coming in line of --- k=strlen(a_i);

#include
#include
using namespace std;
int main()
{
int n,k=0;
cin>>n;
for(int i=1;i<=n;++i)
{
char a_i[100];
cin.getline(a_i,100);
}
for(int i=1;i<=n;++i)
{
k=strlen(a_i);
if(k>10)
cout<<"\n"<<a_i[0]<<(k-2)<<a_i[k-1];
else
cout<<"\n"<<a_i;
}

return 0;

}

Hello @prerak_semwal in the for loop you are forming the character array everytime which is wrong.
could you please elaborate what is the question that you are trying?

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.