\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{EstudianteUpy (Estudianteupy)} \pdfinfo{ /Title (c-info-and-some-basic-characteristics.pdf) /Creator (Cheatography) /Author (EstudianteUpy (Estudianteupy)) /Subject (C info and some basic characteristics Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{562761} \definecolor{LightBackground}{HTML}{F4F1F5} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{C info and some basic characteristics Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{EstudianteUpy (Estudianteupy)} via \textcolor{DarkBackground}{\uline{cheatography.com/124029/cs/23631/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}EstudianteUpy (Estudianteupy) \\ \uline{cheatography.com/estudianteupy} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 3rd July, 2020.\\ Updated 3rd July, 2020.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{3} \begin{tabularx}{5.377cm}{x{1.94103 cm} x{3.03597 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{{\bf{C Cheat sheet}}}} \tn % Row 0 \SetRowColor{LightBackground} \{\{bt\}\}{\bf{Basic Types}} & \{\{bt\}\}Arithmetic types and are further classified into: (a) integer types and (b) floating-point types. \tn % Row Count 5 (+ 5) % Row 1 \SetRowColor{white} \{\{bt\}\}{\bf{Enumerated types}} & \{\{bt\}\}Arithmetic types and they are used to define variables that can only assign certain discrete integer values throughout the program. \tn % Row Count 11 (+ 6) % Row 2 \SetRowColor{LightBackground} \{\{bt\}\}{\bf{The type void}} & \{\{bt\}\}Type specifier void indicates that no value is available. \tn % Row Count 14 (+ 3) % Row 3 \SetRowColor{white} \{\{bt\}\}{\bf{Derived types}} & \{\{bt\}\}Include (a) Pointer types, (b) Array types, (c) Structure types, (d) Union types and (e) Function types. \tn % Row Count 19 (+ 5) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.2531 cm} x{0.91894 cm} x{1.58726 cm} p{0.4177 cm} } \SetRowColor{DarkBackground} \mymulticolumn{4}{x{5.377cm}}{\bf\textcolor{white}{Data types}} \tn % Row 0 \SetRowColor{LightBackground} \{\{bt\}\} {\bf{Integer Types}} & \{\{bt\}\}{\bf{Storage size}} & \{\{bt\}\}{\bf{Value range}} & \{\{bt\}\} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \{\{bt\}\}{\emph{char}} & \{\{bt\}\}1 byte & \{\{bt\}\}-128 to 127 or 0 to 255 & \{\{bt\}\}\%c \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} {\emph{unsigned char}} & 1 byte & 0 to 255 & \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} {\emph{signed char}} & 1 byte & -128 to 127 & \tn % Row Count 9 (+ 2) % Row 4 \SetRowColor{LightBackground} {\emph{int}} & 2 or 4 bytes & -32,768 to 32,767 or -2,147,483,648 to 2,147,483,647 & \%d or \%i \tn % Row Count 13 (+ 4) % Row 5 \SetRowColor{white} {\emph{unsigned int}} & 2 or 4 bytes & 0 to 65,535 or 0 to 4,294,967,295 & \%u \tn % Row Count 16 (+ 3) % Row 6 \SetRowColor{LightBackground} {\emph{short}} & 2 bytes & -32,768 to 32,767 & \%hi \tn % Row Count 18 (+ 2) % Row 7 \SetRowColor{white} {\emph{unsigned short}} & 2 bytes & 0 to 65,535 & \tn % Row Count 20 (+ 2) % Row 8 \SetRowColor{LightBackground} {\emph{long}} & 8 bytes & \seqsplit{-9223372036854775808} to \seqsplit{9223372036854775807} & \%li \tn % Row Count 23 (+ 3) % Row 9 \SetRowColor{white} {\emph{unsigned long}} & 8 bytes & 0 to 184467440737095516\{\{nl\}\}15 & \tn % Row Count 26 (+ 3) % Row 10 \SetRowColor{LightBackground} \{\{bt\}\}{\bf{Floating-Point Types}} & \{\{bt\}\}{\bf{Storage size}} & \{\{bt\}\}{\bf{Value range}} & \{\{bt\}\} \tn % Row Count 29 (+ 3) % Row 11 \SetRowColor{white} {\emph{float}} & 4 byte & 1.2E-38 to 3.4E+38 (6DP) & \%f \tn % Row Count 31 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{1.2531 cm} x{0.91894 cm} x{1.58726 cm} p{0.4177 cm} } \SetRowColor{DarkBackground} \mymulticolumn{4}{x{5.377cm}}{\bf\textcolor{white}{Data types (cont)}} \tn % Row 12 \SetRowColor{LightBackground} {\emph{double}} & 8 byte & 2.3E-308 to 1.7E+308 (15DP) & \%lf \tn % Row Count 2 (+ 2) % Row 13 \SetRowColor{white} {\emph{long double}} & 10 byte & 3.4E-4932 to 1.1E+4932 (19DP) & \%Lf \tn % Row Count 4 (+ 2) % Row 14 \SetRowColor{LightBackground} {\emph{string}} & x50 char & & \%s \tn % Row Count 5 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}----} \SetRowColor{LightBackground} \mymulticolumn{4}{x{5.377cm}}{* DP = Decimal precision.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}----} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.93643 cm} x{2.04057 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Operators}} \tn % Row 0 \SetRowColor{LightBackground} \{\{bt\}\}{\bf{Operators}} & \{\{bt\}\} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \{\{bt\}\}||/| & \{\{bt\}\}Or \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \&\&/\& & And \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} == & Equal to \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} ! & Not \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} != & Non equal to \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} \{\{bt\}\}{\bf{Arithmetic Operators}} & \{\{bt\}\} \tn % Row Count 8 (+ 2) % Row 7 \SetRowColor{white} \{\{bt\}\}+ & \{\{bt\}\}plus \tn % Row Count 9 (+ 1) % Row 8 \SetRowColor{LightBackground} - & rest \tn % Row Count 10 (+ 1) % Row 9 \SetRowColor{white} / & divide \tn % Row Count 11 (+ 1) % Row 10 \SetRowColor{LightBackground} * & product \tn % Row Count 12 (+ 1) % Row 11 \SetRowColor{white} \% & reminder \tn % Row Count 13 (+ 1) % Row 12 \SetRowColor{LightBackground} ++/ -{}- & \seqsplit{Increasing/decreasing} \tn % Row Count 15 (+ 2) % Row 13 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{Comparison}}} \tn % Row Count 16 (+ 1) % Row 14 \SetRowColor{LightBackground} \textless{} & lower than \tn % Row Count 17 (+ 1) % Row 15 \SetRowColor{white} \textless{}= & lower or equal than \tn % Row Count 19 (+ 2) % Row 16 \SetRowColor{LightBackground} \textgreater{}= & greater or equal than \tn % Row Count 21 (+ 2) % Row 17 \SetRowColor{white} \textgreater{} & greater than \tn % Row Count 22 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.54287 cm} x{3.43413 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Main Libraries and Functions}} \tn % Row 0 \SetRowColor{LightBackground} `\textless{}assert.h\textgreater{}` & Program assertion functions \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `\textless{}ctype.h\textgreater{}` & Character type functions \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} `\textless{}locale.h\textgreater{}` & Localization functions \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} `\textless{}math.h\textgreater{}` & Mathematics functions \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} `\textless{}setjmp.h\textgreater{}` & Jump functions \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} `\textless{}signal.h\textgreater{}` & Signal handling functions \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} `\textless{}stdarg.h\textgreater{}` & Variable arguments handling functions \tn % Row Count 8 (+ 2) % Row 7 \SetRowColor{white} `\textless{}stdio.h\textgreater{}` & Standard Input/Output functions \tn % Row Count 10 (+ 2) % Row 8 \SetRowColor{LightBackground} `\textless{}stdlib.h\textgreater{}` & Standard Utility functions \tn % Row Count 11 (+ 1) % Row 9 \SetRowColor{white} `\textless{}string.h\textgreater{}` & String handling functions \tn % Row Count 12 (+ 1) % Row 10 \SetRowColor{LightBackground} `\textless{}time.h\textgreater{}` \{\{bb\}\} & Date time functions \{\{bb\}\} \tn % Row Count 14 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{std functions:}} \newline rand() \newline Returns a (predictable) random integer between 0 and RAND\_MAX based on the randomizer seed. \newline RAND\_MAX \newline The maximum value rand() can generate. \newline srand(unsigned integer); \newline Seeds the randomizer with a positive integer. \newline (unsigned) time(NULL) \newline Returns the computer's tick-tock value. Updates every second.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.34379 cm} x{3.63321 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{i/o functions}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{scanf() and printf() functions}} \{\{bt\}\}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \{\{bt\}\}printf( ) & \{\{bt\}\}returns the number of characters printed by it. \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} scanf() & returns the number of characters read by it. \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{\bf{getchar() \& putchar() functions}} \{\{bt\}\}} \tn % Row Count 6 (+ 1) % Row 4 \SetRowColor{LightBackground} \{\{bt\}\}getchar() & \{\{bt\}\}reads a character from the terminal and returns it as an integer. \tn % Row Count 9 (+ 3) % Row 5 \SetRowColor{white} putchar() & displays the character passed to it on the screen and returns the same character. \tn % Row Count 12 (+ 3) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{gets() \& puts() functions}}\{\{bt\}\}} \tn % Row Count 13 (+ 1) % Row 7 \SetRowColor{white} \{\{bt\}\}gets() & reads a line from `stdin`(standard input) into the buffer pointed to by str pointer, until either a terminating newline or EOF (end of file) occurs. \tn % Row Count 19 (+ 6) % Row 8 \SetRowColor{LightBackground} puts() & writes the `string` str and a trailing newline to {\emph{stdout.}} \tn % Row Count 22 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{The standard input-output header file, named stdio.h contains the definition of the functions printf() and scanf(), which are used to display output on screen and to take input from user respectively.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{ontrol structures and statements}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{Loop structure}} \newline % Row Count 1 (+ 1) A loop structure is used to execute a certain set of actions for a predefined number of times or until a particular condition is satisfied. There are 3 control statements available in C to implement loop structures. {\emph{While, Do while and For statements.}} \newline % Row Count 7 (+ 6) The while statement \newline % Row Count 8 (+ 1) Syntax for while loop is shown below: \newline % Row Count 9 (+ 1) `while(condition)`// {\emph{This condition is tested for TRUE or FALSE. Statements inside curly braces are executed as long as condition is TRUE}} \newline % Row Count 12 (+ 3) `\{` \newline % Row Count 13 (+ 1) `statement 1;` \newline % Row Count 14 (+ 1) `statement 2;` \newline % Row Count 15 (+ 1) `statement 3;` \newline % Row Count 16 (+ 1) `\}` \newline % Row Count 17 (+ 1) The condition is checked for TRUE first. If it is TRUE then all statements inside curly braces are executed. Then program control comes back to check the condition has changed or to check if it is still TRUE. The statements inside braces are executed repeatedly, as long as the condition is TRUE. When the condition turns FALSE, program control exits from while loop. \newline % Row Count 25 (+ 8) The do while statement \newline % Row Count 26 (+ 1) Syntax for do while loop is shown below: \newline % Row Count 27 (+ 1) `do` \newline % Row Count 28 (+ 1) `\{` \newline % Row Count 29 (+ 1) `statement 1;` \newline % Row Count 30 (+ 1) } \tn \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{ontrol structures and statements (cont)}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{`statement 2;` \newline % Row Count 1 (+ 1) `statement 3;` \newline % Row Count 2 (+ 1) `\}` \newline % Row Count 3 (+ 1) `while(condition); \newline % Row Count 4 (+ 1) The for statement \newline % Row Count 5 (+ 1) Syntax of for statement is shown below: \newline % Row Count 6 (+ 1) `for(initialization statements;test condition;iteration statements)` \newline % Row Count 8 (+ 2) `\{` \newline % Row Count 9 (+ 1) `statement 1;` \newline % Row Count 10 (+ 1) `statement 2;` \newline % Row Count 11 (+ 1) `statement 3;` \newline % Row Count 12 (+ 1) `\}`% Row Count 13 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Control structures}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{Selective control structure}} \newline % Row Count 1 (+ 1) Selection structures are used to perform 'decision making' and then branch the program flow based on the outcome of decision making. Selection structures are implemented in C with If, If Else and Switch statements. \newline % Row Count 6 (+ 5) The syntax format of a simple if statement is as shown below. \newline % Row Count 8 (+ 2) `if (expression)` // {\emph{This expression is evaluated. If expression is TRUE statements inside the braces will be executed}} \newline % Row Count 11 (+ 3) `\{` \newline % Row Count 12 (+ 1) `statement 1;` \newline % Row Count 13 (+ 1) `statement 2;` \newline % Row Count 14 (+ 1) `\}` \newline % Row Count 15 (+ 1) `statement 1; `// {\emph{Program control is transfered directly to this line, if the expression is FALSE}} \newline % Row Count 17 (+ 2) `statement 2;` \newline % Row Count 18 (+ 1) Syntax format for If Else statement is shown below. \newline % Row Count 20 (+ 2) `if(expression 1)` // {\emph{Expression 1 is evaluated. If TRUE, statements inside the curly braces are executed.}} \newline % Row Count 23 (+ 3) `\{` // {\emph{If FALSE program control is transferred to immediate else if statement.}} \newline % Row Count 25 (+ 2) `statement 1;` \newline % Row Count 26 (+ 1) `statement 2;` \newline % Row Count 27 (+ 1) `\}` \newline % Row Count 28 (+ 1) `else if(expression 2)`// If expression 1 is FALSE, expression 2 is evaluated. \newline % Row Count 30 (+ 2) } \tn \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Control structures (cont)}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{`\{` \newline % Row Count 1 (+ 1) `statement 1;` \newline % Row Count 2 (+ 1) `statement 2;` \newline % Row Count 3 (+ 1) `\}` \newline % Row Count 4 (+ 1) `else if(expression 3)` // {\emph{If expression 2 is FALSE, expression 3 is evaluated}} \newline % Row Count 6 (+ 2) `\{` \newline % Row Count 7 (+ 1) `statement 1;` \newline % Row Count 8 (+ 1) `statement 2;` \newline % Row Count 9 (+ 1) `\}` \newline % Row Count 10 (+ 1) `else` // {\emph{If all expressions (1, 2 and 3) are FALSE, the statements that follow this else (inside curly braces) is executed.}} \newline % Row Count 13 (+ 3) `\{` \newline % Row Count 14 (+ 1) `statement 1;` \newline % Row Count 15 (+ 1) `statement 2;` \newline % Row Count 16 (+ 1) `\}` \newline % Row Count 17 (+ 1) `other statements;` \newline % Row Count 18 (+ 1) Switch statement \newline % Row Count 19 (+ 1) Switch is a multi branching control statement. Syntax for switch statement is shown below. \newline % Row Count 21 (+ 2) `switch(expression)`// {\emph{Expression is evaluated. The outcome of the expression should be an integer or a character constant}} \newline % Row Count 24 (+ 3) `\{` \newline % Row Count 25 (+ 1) `case value1:` // {\emph{case is the keyword used to match the integer/character constant from expression.}} \newline % Row Count 28 (+ 3) //{\emph{value1, value2 ... are different possible values that can come in expression}} \newline % Row Count 30 (+ 2) } \tn \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Control structures (cont)}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{statement 1; \newline % Row Count 1 (+ 1) `statement 2;` \newline % Row Count 2 (+ 1) `break;` // {\emph{break is a keyword used to break the program control from switch block.}} \newline % Row Count 4 (+ 2) `case value2:` \newline % Row Count 5 (+ 1) `statement 1;` \newline % Row Count 6 (+ 1) `statement 2;` \newline % Row Count 7 (+ 1) `break;` \newline % Row Count 8 (+ 1) `default:` // {\emph{default is a keyword used to execute a set of statements inside switch, if no case values match the expression value.}} \newline % Row Count 11 (+ 3) `statement 1;` \newline % Row Count 12 (+ 1) `statement 2;` \newline % Row Count 13 (+ 1) `break;` \newline % Row Count 14 (+ 1) `\}`% Row Count 15 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}