Just modifying the logic of chirag a bit to cover the full integer return in place of just digit.
#include <stdio.h>
int main(void) {
char *a="My 10a10 and 20";
int abc, i, count;
for(i=0;a[i];i++)
{
if((a[i]>=48) && (a[i]<=57))
{
sscanf(&a[i], "%d", &abc);
printf("%d\n", abc);
// Get the digit count to adjust i
while(abc != 0)
{
abc/=10;
++i;
}
}
}
return 0;
}