Jan 27, 2017 Basic difference beyween printf and cprintf is printf command is available in library, where as cprintf is available in. Speaking technically, printf command returns it output to both console and also to stdout due to its invol.
Printf prototype int printf( const char. format. ); The printf function writes the string pointed to by format to stdout. The string format may contain format specifiers starting with% which are replaced by the values of variables that are passed to the printf function as additional arguments. It is defined in header file.
Mar 06, 2011 Didn't notice that line. In that case, you ought to also use cstdlib instead of stdlib.h Though TBH, if you are writing C you should just use the C libraries instead of the C standard library.
C++ Useful Resources
Selected Reading
Unlike for and while loops, which test the loop condition at the top of the loop, the do...while loop checks its condition at the bottom of the loop.
A do...while loop is similar to a while loop, except that a do...while loop is guaranteed to execute at least one time.
Syntax
The syntax of a do...while loop in C++ is −
Notice that the conditional expression appears at the end of the loop, so the statement(s) in the loop execute once before the condition is tested.
If the condition is true, the flow of control jumps back up to do, and the statement(s) in the loop execute again. This process repeats until the given condition becomes false.
Flow Diagram
Example
When the above code is compiled and executed, it produces the following result −