Conversion Specifications for function printf() - C Reference

C examples for Reference:Language Reference

Introduction

C.S.Output Data and Supported Types
%c character. Types: char.
%d decimal integer. Types: short int, int, signed int, signed short int, unsigned short int.
%hd decimal integer. Types: short int, signed short int, unsigned short int.
%ld decimal integer. Types: long int, signed long int.
%i octal, hexadecimal, or decimal integer. Types: short int, int, signed int, signed short int, unsigned short int.
%li octal, hexedecimal, or decimal integer. Types: long int, signed long int.
%o octal integer. Types: unsigned short int, unsigned int.
%lo octal integer. Types: unsigned long int.
%u unsigned decimal integer. Types: unsigned int.
%lu decimal integer. Types: unsigned long int.
%x hexadecimal integer. unsigned short int, unsigned int.
%lx hexadecimal integer. unsigned long int.
%s string of non-white space characters which is not delimted by double quotes.
%f floating-point number. Displays number in standard form. Types: float.
%e floating-point number. Displays number in exponent form. Types: float.
%g floating-point number. Displays number in exponent form. Suppresses trailing zeros after decimal point. Types: float.
%lf floating-point number. Displays number in standard form. Types: double.
%le floating-point number. Displays number in exponent form. Types: double.
%lg floating-point number. Displays number in exponent form. Suppresses trailing zeros after decimal point. Types: double.
%Lf floating-point number. Displays number in standard form. Types: long double.
%Le floating-point number. Displays number in exponent form. Types: long double.
%Lg floating-point number. Displays number in exponent form. Suppresses trailing zeros after decimal point. Types: long double.

Related Tutorials