You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thomas Foster edited this page Apr 15, 2021
·
1 revision
Function Writes formatted output to the screen.
Syntaxint cprintf(const char *format, ...);
Prototype in conio.h
Return valuecprintf returns the number of characters output.
See alsoputch, cputs
Remarks
cprintf accepts a series of arguments, applies to each a format specification contained in the format string pointed to by format, and outputs the formatted data directly to the screen, to the current text window. There must be the same number of format specifications as arguments. For more information, see printf from the C Standard Library.
Example
intvalue=110;
cprintf("Decimal value %d is hex: %X, octal: %o, character: %c\n", value, value, value, value);