The most commonly needed printf() Conversion Specifiers - C Language Basics

C examples for Language Basics:printf

Introduction

Specifier MeaningTypes Converted
%c Single character char
%d Signed decimal integerint, short
%ldSigned long decimal integer long
%f Decimal floating-point numberfloat, double
%s Character string char arrays
%u Unsigned decimal integer unsigned int, unsigned short
%luUnsigned long decimal integer unsigned long

Related Tutorials