You are here : Cstdio.hprintf

printf() - stdio.h

To display on console.


Syntax

int printf(const char *format, ...)


Example

/* printf example */
#include <stdio.h>

int main()
{
   printf ("Characters: %c %c",'a',65);
   printf ("Decimals: %d %ld",1977,650000L);
   printf ("Preceding with blanks: %10d ",1977);
   printf ("Preceding with zeros: %010d ",1977);
   printf ("Some different radices: %d %x %o %#x %#o ", 100, 100, 100, 100, 100);
   printf ("floats: %4.2f %+.0e %E ", 3.1416, 3.1416, 3.1416);
   printf ("Width trick: %*d ", 5, 10);
   printf ("%s ", "A string");
   return 0;
}


Output / Return Value

Something will be printed on screen.


Limitations

Nothing As of Now


Alternatives / See Also

puts() - For Strings


Reference

tutorialspoint.com