0% found this document useful (0 votes)
4 views

Programming Fundamental

This document is a cheat sheet covering fundamental programming concepts applicable across various languages such as Python, Java, C++, and JavaScript. It includes key topics like syntax, data types, variables, conditions, loops, functions, and arrays/lists, with examples provided for each language. The document serves as a quick reference for essential programming principles and syntax.

Uploaded by

hetjoshi022
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Programming Fundamental

This document is a cheat sheet covering fundamental programming concepts applicable across various languages such as Python, Java, C++, and JavaScript. It includes key topics like syntax, data types, variables, conditions, loops, functions, and arrays/lists, with examples provided for each language. The document serves as a quick reference for essential programming principles and syntax.

Uploaded by

hetjoshi022
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Programming

fundamentals
This Cheat Sheet covers key concepts across
most programming languages like Python, Java,
C++, and JavaScript.

syntax
Set of rules that defines how
programs must be written in a
programming language.

Data type
Categories of data e.g., int,
integer, float, character, float
boolean, string

variable
Named storage locations used
to hold values that can change
during program execution.

condition
Used to perform different
if else
actions based on different
conditions

Loops
A way to repeat a block of for
code multiple times. while

function
Blocks of reusable code that
perform a specific task
when called.

arrays / Lists
Ordered collections of elements
that can be accessed using
indices.
Programming
fundamentals
The key concepts are explained using the
syntax of Python programming language.

syntax
print("Hello") output

Data type
int, float, double
char
bool, text

variable
x = 10
name = "Alice"
gpa = 3.4

condition
if x > 0:
print("Positive") if else
else:
print("Negative")

Loops
for x in range(x):
for
statement(s)
while condition: while
statement(s)

function
def greet(name):
return "Hello " + name

arrays / Lists
nums = [1, 2, 3]
nums[0] = 10
Programming
fundamentals
The key concepts are explained using the Java
Script examples.

syntax
console.log("Hello"); output

Data type
int, float, char
bool, string

variable
let x = 10;
let name = "Alice";
let pi = 3.14;

condition
if (x > 0) {
console.log("Positive"); if else
} else {
console.log("Non-positive");}

for (let i = 0; i < 5; i++) {


console.log(i); }
let i = 0; loops
while (i < 5) {
console.log(i++);}

function
function square(x) {
return x * x;
}

arrays / Lists
let nums = [1, 2, 3];
console.log(nums[0]);
Programming
fundamentals
The key concepts are explained using the
examples of C++.

syntax
cout << "Hello, world!"; output

Data type
int, float, char
bool, string

variable
int x = 10;
string name = "Alice";
float pi = 3.14;

condition
if (x > 0) {
cout << "Positive"; if else
} else {
cout << "Non-positive";}

for (int i = 0; i < 5; i++) {


cout << i << " "; }
int i = 0; loops
while (i < 5) {
cout << i ++<< " ";}

function
int square(int x) {
return x * x;
}

arrays / Lists
int nums[ ] = {1, 2, 3};
cout << nums[0];

You might also like