This repository is dedicated to helping beginners learn C++ programming basics in a concise and interactive manner. Each code file includes proper comments explaining every block of code, making it easier for learners to understand.
- input.txt: Contains sample input for the programs.
- output.txt: Contains the expected output corresponding to the input in
input.txt
.
- tasks.json: Helps to automate taking input from
input.txt
and place the output inoutput.txt
.
- Clone this repository to your local machine.
- Navigate to the directory where you have cloned the repository.
- Open any C++ file using a text editor or an IDE.
- Compile and run the program using your preferred compiler or IDE.
basic_i_o_code-1.cpp
: Illustrates basic input/output operations, showcasing how to usecin
andcout
for reading and writing data.namespace_code-2.cpp
: Demonstrates the usage of namespaces, explaining how to avoid naming conflicts and organize code.cout_cin_code-3.cpp
: Example code demonstrating input and output usingcin
andcout
in C++, including formatted input/output.data_type_code-4.cpp
: Example code demonstrating different data types in C++, such asint
,float
,double
,char
, andbool
.if_else_code-5.cpp
: Example code demonstrating if-else statements and the use of the switch keyword in C++ for conditional logic.array_code-6.cpp
: Example code demonstrating array usage in C++, including initialization, accessing elements, and basic operations.do_while_code-7.cpp
: Example code demonstrating the do-while loop in C++.string_code-8.cpp
: Example code demonstrating string operations in C++, such as concatenation, comparison, and length calculation.for_loop_code-9.cpp
: Example code demonstrating the use of for loops in C++ for iterating over arrays and ranges.pointers_code-10.cpp
: Example code demonstrating the use of pointers in C++, including pointer arithmetic and memory addresses.function_code-11.cpp
: Example code demonstrating functions in C++.....
Contributions are welcome! Feel free to contribute by adding more basic C++ programs, improving existing ones, or fixing issues.