void main(void) { char ebit,ans; ebit = 0x01; ans = ebit*(100/256); } how can i display the value in ans on LCD ? void lcdPutStr (char *string) { char i; i=0; while(string[i]) { lcdPutCh (string[i++]); } } this is the program segment for putting the characters into LCD
You need to get a new 'C' book, then! Look in the C51 Manual
It's "sprintf", short for "string printf". It works just like printf(), except that the very first parameter is a string to which the results are output: char buf[80]; sprintf (buf, "%d\n", myInt); You also may have an "snprintf()" to keep you from overrunning your output buffer. http://www.dinkumware.com/manuals/reader.aspx?b=c/&h=stdio.html#sprintf Some online C references: http://www-ccs.ucsd.edu/c/ http://www.dinkumware.com/libraries_ref.html Source code for string functions you don't have: http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/string/
"You also may have..." To find out exactly what you do have, look in the C1 Manual!!