From 76e876948630e60ef9302885f180b2c206410932 Mon Sep 17 00:00:00 2001 From: a2nr Date: Sun, 4 Jan 2026 12:49:00 +0700 Subject: [PATCH] exclude content to uaed in other repository to make complete learning --- content/{home.md => home.md.exclude} | 0 content/introduction_to_c.md | 123 --------------------------- content/introduction_to_c.md.exclude | 33 +++++++ content/variables_and_data_types.md | 98 --------------------- 4 files changed, 33 insertions(+), 221 deletions(-) rename content/{home.md => home.md.exclude} (100%) delete mode 100644 content/introduction_to_c.md create mode 100644 content/introduction_to_c.md.exclude delete mode 100644 content/variables_and_data_types.md diff --git a/content/home.md b/content/home.md.exclude similarity index 100% rename from content/home.md rename to content/home.md.exclude diff --git a/content/introduction_to_c.md b/content/introduction_to_c.md deleted file mode 100644 index 7741082..0000000 --- a/content/introduction_to_c.md +++ /dev/null @@ -1,123 +0,0 @@ ----LESSON_INFO--- -**Learning Objectives:** -- Understand basic syntax and structure of C programs -- Learn how to write your first C program -- Familiarize with the compilation process - -**Prerequisites:** -- Basic understanding of programming concepts -- Familiarity with command line interface (optional) - ----END_LESSON_INFO--- -# Introduction to C Programming - -C is a general-purpose, procedural computer programming language supporting structured programming, lexical variable scope, and recursion, with a static type system. By design, C provides constructs that map efficiently to typical machine instructions, which has made it one of the most widely used programming languages. - - -# Your First C Program Exercise - -Write a C program that prints your name and your favorite programming language to the console. - -**Requirements:** -- Use `printf` to output your name -- Include your favorite programming language in the output -- Make sure to include the standard input/output library -- The output should be in the format: "Hello, I am [Your Name] and my favorite programming language is [Language]" - -**Example Output:** -``` -Hello, I am John and my favorite programming language is C -``` - -Try writing your solution in the code editor below! - -## History of C - -C was originally developed at Bell Labs by Dennis Ritchie between 1972 and 1973. It was created to re-implement the Unix operating system, which was previously coded in assembly language. - -## Basic Structure of a C Program - -A basic C program consists of: -- Preprocessor directives -- Function definitions -- Variable declarations -- Comments -- Executable statements - -Here's a simple example: - -```c -#include - -int main() { - printf("Hello, World!\n"); - return 0; -} -``` - -## Key Concepts - -1. **Variables**: Storage locations with a name and data type -2. **Data Types**: Define what kind of value a variable can hold -3. **Functions**: Blocks of code that perform specific tasks -4. **Control Structures**: Direct the flow of program execution - ---- -## Common Data Types in C - -| Type | Description | Example | -|------|-------------|---------| -| int | Integer values | `int age = 25;` | -| float | Floating-point numbers | `float price = 19.99;` | -| char | Single character | `char grade = 'A';` | -| double | Double precision float | `double pi = 3.14159;` | - - ----EXERCISE--- - -# Your First C Program Exercise - -Write a C program that prints your name and your favorite programming language to the console. - -**Requirements:** -- Use `printf` to output your name -- Include your favorite programming language in the output -- Make sure to include the standard input/output library -- The output should be in the format: "Hello, I am [Your Name] and my favorite programming language is [Language]" - -**Expected Output:** -``` -Hello, I am John and my favorite programming language is C -``` - -Try writing your solution in the code editor below! - - ----EXPECTED_OUTPUT--- -Hello, I am John and my favorite programming language is C - ----END_EXPECTED_OUTPUT--- - ----INITIAL_CODE--- -#include - -int main() { - // Write your code here - printf("Hello, World!\\n"); - return 0; -} ----END_INITIAL_CODE--- - - ----SOLUTION_CODE--- -#include - -int main() { - // Write your code here - printf("Hello, I am John and my favorite programming language is C\n"); - return 0; -} ----END_SOLUTION_CODE--- - - -- diff --git a/content/introduction_to_c.md.exclude b/content/introduction_to_c.md.exclude new file mode 100644 index 0000000..fa17a7d --- /dev/null +++ b/content/introduction_to_c.md.exclude @@ -0,0 +1,33 @@ +# Welcome to C Programming Learning System + +This is a comprehensive learning platform designed to help you master the C programming language through interactive lessons and exercises. + +## Learning Objectives + +| Module | Objective | Skills Acquired | +|--------|-----------|-----------------| +| Introduction to C | Understand basic syntax and structure | Writing first C program | +| Variables & Data Types | Learn about different data types | Proper variable declaration | +| Control Structures | Master conditional statements and loops | Logic implementation | +| Functions | Create and use functions | Code organization | +| Arrays & Pointers | Work with complex data structures | Memory management | + +## How to Use This System + +1. **Browse Lessons**: Select from the available lessons on the left +2. **Read Content**: Study the lesson materials and examples +3. **Practice Coding**: Use the integrated code editor to write and test C code +4. **Complete Exercises**: Apply your knowledge to solve programming challenges +5. **Get Feedback**: See immediate results of your code execution + +## Getting Started + +Start with the "Introduction to C" lesson to begin your journey in C programming. Each lesson builds upon the previous one, so it's recommended to follow them in order. + +Happy coding! + +---Available_Lessons--- + +1. [Introduction to C Programming](lesson/introduction_to_c.md) +2. [Variables and Data Types in C](lesson/variables_and_data_types.md) + diff --git a/content/variables_and_data_types.md b/content/variables_and_data_types.md deleted file mode 100644 index 385c1c5..0000000 --- a/content/variables_and_data_types.md +++ /dev/null @@ -1,98 +0,0 @@ -# Variables and Data Types in C - -In C programming, variables are used to store data that can be manipulated during program execution. Each variable has a specific data type that determines the size and layout of the variable's memory, the range of values that can be stored, and the set of operations that can be applied to the variable. - -## Declaring Variables - -![variable](/assets/InitilizationofaVariable-660x330.png) - -To use a variable in C, you must first declare it. The syntax for declaring a variable is: - -```c -data_type variable_name; -``` - -For example: -```c -int age; -float height; -char initial; -``` - -You can also initialize variables at the time of declaration: - -```c -int age = 25; -float height = 5.8; -char initial = 'J'; -``` - -## Common Data Types - -### Integer Types -- `int`: Used for integers (whole numbers) -- `short`: Short integer -- `long`: Long integer -- `long long`: Extended size integer - -### Floating-Point Types -- `float`: Single precision floating-point -- `double`: Double precision floating-point -- `long double`: Extended precision floating-point - -### Character Types -- `char`: Single character or small integer - -### Void Type -- `void`: Represents the absence of type - -## Variable Naming Rules - -1. Variable names must begin with a letter or underscore -2. Names can contain letters, digits, and underscores -3. Names are case-sensitive -4. Names cannot be keywords (like `int`, `char`, etc.) -5. Names should be descriptive - -## Constants - -Constants are fixed values that your program cannot alter during execution. They can be: -- Integer constants: `100`, `-50`, `0` -- Floating-point constants: `3.14`, `-2.5`, `0.001` -- Character constants: `'a'`, `'X'`, `'3'` -- String literals: `"Hello, World!"` - ---- - ----EXERCISE--- - -# Variables and Data Types Exercise - -Write a C program that declares variables of different data types and prints their values. - -**Requirements:** -1. Declare an integer variable called `quantity` and assign it the value 42 -2. Declare a float variable called `price` and assign it the value 19.99 -3. Declare a character variable called `grade` and assign it the value 'A' -4. Declare a double variable called `pi` and assign it the value 3.14159 -5. Print all variables with appropriate labels - -**Expected Output:** -``` -Quantity: 42 -Price: 19.990000 -Grade: A -Pi: 3.141590 -``` - -Remember to include the stdio.h header file and use the correct format specifiers in printf statements (%d for int, %f for float/double, %c for char). - -Try writing your solution in the code editor below! - - ----EXPECTED_OUTPUT--- - -Quantity: 42 -Price: 19.990000 -Grade: A -Pi: 3.141590