C examples for Data Type:Introduction
Conversion specifiers has two parts:
The following table describes the most common conversion specifiers.
Conversion Specifier | Description |
---|---|
%d | Displays integer value |
%f | Displays floating-point numbers |
%c | Displays character |
#include <stdio.h> int main()//from ww w .j a v a 2 s. co m { //variable declarations int x; float y; char c; //variable initializations x = -10000; y = 12123.11232; c = 'A'; //printing variable contents to standard output printf("\nThe value of integer variable x is %d", x); printf("\nThe value of float variable y is %f", y); printf("\nThe value of character variable c is %c\n", c); }