C Cheat Sheet Expanded
C Cheat Sheet Expanded
C Cheat Sheet
1. Basic Syntax
#include <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}
2. Data Types
3. Operators
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulus
== Equal to
!= Not equal to
>= Greater than or equal to
<= Less than or equal to
4. Control Statements
if (condition) {
// code block
} else {
Java Cheat Sheet
switch(expression) {
case value1:
// code
break;
default:
// code
}
5. Loops
while (condition) {
// loop body
}
6. Functions
7. Pointers
int a = 10;
int *ptr = &a;
printf("%d", *ptr); // Prints value at address stored in ptr
8. File Handling
#include <stdio.h>
Java Cheat Sheet
9. Standard Libraries