A program with a function that converts a string of digits into an integer value
is this code efficient ?

No.  Rather than using the unnecessary powe(), lent(),

simply scale by 10 each operation; and
use - '0'.

.
char sn[20];
//scanf(&quot;%s&quot;,sn);
if (scanf(&quot;%19s&quot;, sn) == 1) {
  int z = 0;
  for (int i = 0; sn[i] &gt;= '0' &amp;&amp; sn[i] &lt;= '9'; i++) {
    z = z*10 + (sn[i] - '0');
  }
  printf(&quot;%d&quot;,z);
}

Even better code would detect overflow and maybe use unsigned and/or wider types.