Printf Function
In C programming language, printf() function is used to print or display the value of variables (“character, string, float, integer, octal and hexadecimal”) onto the output screen(Console) with the help of format specifier of its related datatype.
It is a library function to send formatted output to the screen. This function prints the string as it is on output screen that written inside double quotations.
Syntax:
printf("String/Comment",Variable_name);
/* Example program to print integer number */
#include<stdio.h> //
Header Files
#include<conio.h>
void main() //Entry
point of compiler or starting point of execution
{
int
num=100; // Variable declaration
& initialization.
printf("Printing
a number:%d",num); // Printing
the output
}
Note:
"%d is a format specifier which is used to print an integer value on the console."
Comments
Post a Comment