UNIVERSITY OF WEST ATTICA
SCHOOL OF ENGINEERING
DEPARTMENT OF COMPUTER ENGINEERING AND INFORMATICS
Computer Programming
Vasileios Evangelos Athanasiou
Student ID: 19390005
Supervisor: Georgios Meletiou, Laboratory Teaching Staff
Athens, November 2021
The project covers fundamental concepts of the C programming language, with emphasis on variables, standard input/output, operators, and increment mechanisms, supported by practical source code examples.
| Section | Folder / File | Description |
|---|---|---|
| 1 | assign/ |
Assignment material |
| 1.1 | assign/project2.png |
Assignment description / problem statement (English) |
| 1.2 | assign/εργασία2.png |
Assignment description / problem statement (Greek) |
| 2 | docs/ |
Theoretical documentation |
| 2.1 | docs/Basic-Elements.pdf |
Basic programming elements and concepts (English) |
| 2.2 | docs/Βασικά-Στοιχεία.pdf |
Basic programming elements and concepts (Greek) |
| 3 | src/ |
Source code implementations |
| 3.1 | src/CubeSphere.c |
Geometric computation: cube–sphere problem |
| 3.2 | src/MathsIntegers.c |
Integer arithmetic and mathematical operations |
| 4 | README.md |
Repository overview and instructions |
A variable is a designated memory location used to temporarily store data during program execution.
- The stored data can change during execution.
- Users define meaningful variable names for easier understanding and maintenance.
int– Integersfloat,double– Decimal (floating-point) numberschar– Single charactersbool– Logical (true/false) values
- The input channel, usually the keyboard, used to enter data into a program.
- Function:
scanf()- Reads user input.
- Stores it in a variable using the address-of operator (
&).
- The output channel, usually the screen, used to display program data.
- Function:
printf()- Prints text messages or variable values to the console.
Used to perform mathematical calculations:
- Addition (
+) - Subtraction (
-) - Multiplication (
*) - Division (
/) - Modulus (
%)
Used to compare values and return:
1(True) or0(False)
Examples:
==,!=,<,>
Used to combine or negate conditions:
| Operator | Description |
|---|---|
&& (AND) |
Produces 1 only if both operands are 1 |
|| (OR) |
Produces 1 if at least one operand is 1 |
! (NOT) |
Reverses the logical value (1 → 0, 0 → 1) |
-
Pre-increment (
++x)
Increases the variable value by one before it is used in an expression. -
Post-increment (
x++)
Uses the current value of the variable before increasing it by one.
The following programs are included and fully documented in the report:
-
MathsIntegers.c
Focuses on:- Integer arithmetic
- Program structure
- Variable usage and value flow
-
CubeSphere.c
Covers:- Calculations related to geometric shapes
- Example computations
- Technical remarks and implementation details
This repository contains introductory C programming material developed for the
Computer Programming course at University of West Attica (UNIWA).
-
C Compiler
- Recommended:
- GCC (Linux / macOS / Windows via MinGW or WSL)
- Recommended:
-
Text Editor or IDE
- Visual Studio Code
(Recommended) - Code::Blocks
- Dev-C++
- CLion
- Any plain text editor
- Visual Studio Code
- Windows
- Linux
(Recommended) - macOS
Clone the repository to your local machine:
git clone https://github.com/Computer-Programming-aka-Uniwa/Basic.git- Open the repository URL in your browser
- Click Code → Download ZIP
- Extract the ZIP file to a local directory
cd Basic/srcUsing GCC:
gcc MathsIntegers.c -o MathsIntegers -lm
-lmis required to link the math library
gcc CubeSphere.c -o CubeSphereLinux / macOS:
./MathsIntegers./CubeSphereWindows:
MathsIntegers.exeCubeSphere.exe- Navigate to the
docs/directory - Open the report corresponding to your preferred language:
- English:
Basic-Elements.pdf - Greek:
Βασικά-Στοιχεία.pdf
- English:
