INTRODUCTION TO SYNTAX

by Goodluck Chioma


mes given to variables, functions, or classes.

Rules: Must start with a letter or an underscore, and cannot be a keyword.

Example:

Let userName = “John”;



4. Literals

Fixed values like numbers, strings, or booleans.

Example:

X = 10 # Integer literal
Y = “Hello” # String literal



5. Data Types

Define the type of value stored in variables, such as int, float, string, boolean.

Example (C++):

Int age = 25;



6. Punctuation

Symbols used for structuring code, like ;, {}, ().

Example ©:

Printf(“Hello, World!”);



7. Comments

Lines of text ignored by the compiler, used to explain code.

Example:

// This is a single-line comment






Syntax Rules Across Languages

1. C

Case-sensitive.

Uses semicolons ; to end statements.

Curly braces {} define blocks of code.

Example:

Int main() {
Printf(“Hello, World!”);
Return 0;
}



2. Python

Indentation is mandatory to define cod