Simple Example Program For Printf

Definition:

In C,the printf function writes a formatted string.

Syntax:

printf("Text to be displayed : %access_specifiers", variable);

Simple Example For Print a Number

/* Example program to print a number In C Programming Language*/
// Header Files
#include<stdio.h>
#include<conio.h>

//Main Function
int main()
{
	// Assigining the variable num
	int num=100;
	
	// Printing the output
	printf("Printing a number:%d",num);
	
	// Output screen waits until get a character
	getch();
	
	// Returning to the main function
	return 0;
}

Sample Output:

Printing a number:100

 

Top Pages