Skip to main content

Posts

Showing posts with the label C language cheatsheet

C language cheatsheet

C Language CheatSheet Loading... Basics Basic syntax and functions from the C programming language. Boilerplate Code # include <stdio.h> int main ( ) { return ( 0 ) ; } Copy printf function It is used to show output on the screen printf ( "Hello World!" ) Copy scanf function It is used to take input from the user scanf ( "placeholder" , variables ) Copy Comments A comment is the code that is not executed by the compiler, and the programmer uses it to keep track of the code. Single line comment // It's a single line comment Copy Multi-line comment /* It's a multi-line comment */ Copy Data types The data type is the type of data Character type Typically a single octet(one byte). It is an integer type char variable_name ; Copy Integer type The most natural size of integer for the machine int variable_name ; Copy Float type A single-precision floating-point value float variable_name ; Copy Double type A double-precision floating-point value doubl...