Skip to main content\(\newcommand{\N}{\mathbb N}
\newcommand{\Z}{\mathbb Z}
\newcommand{\Q}{\mathbb Q}
\newcommand{\R}{\mathbb R}
\newcommand{\lt}{<}
\newcommand{\gt}{>}
\newcommand{\amp}{&}
\definecolor{fillinmathshade}{gray}{0.9}
\newcommand{\fillinmath}[1]{\mathchoice{\colorbox{fillinmathshade}{$\displaystyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\textstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptscriptstyle\phantom{\,#1\,}$}}}
\)
Section 4.12 Summary
Here is what we have learned in this chapter:
-
Integer numbers can be stored efficiently in the int
datatype, characters in the char
datatype and floating point numbers in the float
datatype.
-
The format specifiers for these datatypes are %d
, %c
and %f
.
- To read user input into these datatypes, use:
scanf("%d", &age);
scanf("%c", &letter);
scanf("%f", &height);