Displaying Integer Data Types with printf() - C Data Type

C examples for Data Type:Introduction

Introduction

Integer data types can easily be displayed using the %d conversion specifier with a printf() statement.

Demo Code

#include <stdio.h>

int main()/*www. j  av a2s  . c om*/
{
    printf("%d", 55); 
    return 0;
}

Result

The %d conversion specifier can also be used to output the contents of a variable declared as integer data type.

Demo Code

#include <stdio.h>

int main()//  w w  w. j  a va  2s. c om
{
    int operand1;  
    
    operand1 = 29; 
    
    printf("The value of operand1 is %d", operand1); 
    return 0;
}

Result


Related Tutorials