
Patrick B. answered 07/04/19
Math and computer tutor/teacher
//write the number to a string buffer and output the last character
#include <stdio.h>
int main(void)
{
long longIntNum = 123456;
int iStrLen;
char outbuff[255];
sprintf(outbuff,"%ld",longIntNum);
iStrLen = strlen(outbuff);
printf(">%s< : iStrLen = %d \n",outbuff,iStrLen);
printf(" THe last digit is %c \n",outbuff[iStrLen-1]);
}