Programming Languages

Programming Languages

Share

this page is about learning programming from basic to advance level including projects

03/12/2025

# # # **๐Ÿ“˜ C++ โ€“ Introduction to Functions (With Example)**

In C++, **functions** help you write cleaner, reusable, and more organized code.
Instead of repeating the same code again and again, you write it once inside a functionโ€”and call it whenever needed.

---

# # # โœ… **Basic Structure of a C++ Function**

returnType functionName(parameters) {
// code to execute
}
```

---

# # # โœ… **Example: A Simple Function in C++**


using namespace std;

// Function declaration
void greet() {
cout

19/11/2025

# # ๐Ÿ’ป **C++ Tutorial โ€” Topic 8: Switch Statement (Multiple Choices Made Easy)**

Sometimes your program needs to choose from **many options**, not just true/false.
Thatโ€™s where the **switch statement** becomes super useful! ๐ŸŽ›๏ธ

# # # ๐Ÿ”น **What is a Switch Statement?**

It lets you test **one variable** against **multiple possible values**, making your code cleaner and easier to read.

# # # ๐Ÿ’ก **Example: Simple Menu Program**

```cpp

using namespace std;

int main() {
int option;
cout > option;

switch(option) {
case 1:
cout

08/11/2025

Topic # 7: Level Up Your Logic โ€” Loops in C++ ๐Ÿ”

After mastering Decision Making, itโ€™s time to make your code repeat smartly! ๐Ÿ˜Ž
Thatโ€™s where loops come in โ€” they help you execute a block of code multiple times until a condition is met.

โœจ Types of Loops in C++:
1๏ธโƒฃ for loop โ€” repeat a known number of times
2๏ธโƒฃ while loop โ€” repeat while a condition is true
3๏ธโƒฃ do...while loop โ€” executes at least once, then checks

๐Ÿง  Example:

for(int i = 1; i

06/11/2025

๐Ÿ’ป **C++ Tutorial โ€” Topic 6: Decision Making with if-else Statements**

So far, your programs can *calculate* โ€” but can they *think*? ๐Ÿง 
Letโ€™s make them smart with **decision-making statements** โ€” using `if`, `else if`, and `else`! โšก

---

# # # ๐Ÿ”น **What is an if-else statement?**

It lets your program **choose** what to do based on conditions.

๐Ÿ‘‰ Think of it like:
โ€œIf itโ€™s raining, take an umbrella. Otherwise, go outside freely.โ€ โ˜”

---

# # # ๐Ÿงฉ Example:

```cpp

using namespace std;

int main() {
int marks;
cout > marks;

if (marks >= 80) {
cout

05/11/2025

Shout out to my newest followers! Excited to have you onboard! Haroon Irfan Kahout King, Mueez Ahmad, M Inam Tabasum, Naqsh Lazim, Zahra Lassaci

04/11/2025

๐Ÿ’ป **C++ Tutorial โ€” Topic 5: Operators in C++**

Now that we can take input and display output,
letโ€™s learn how to **process data** using *operators*! โš™๏ธ

Operators help us perform calculations, make decisions, and manipulate data inside our programs.

---

# # # ๐Ÿ”น **Types of Operators**

1. **Arithmetic Operators:** `+ - * / %`
2. **Assignment Operators:** `= += -= *= /=`
3. **Comparison Operators:** `== != > < >=

03/11/2025

๐Ÿ’ป **C++ Tutorial โ€” Topic 4: Input & Output in C++**

Now that we know how to store data using variables,
letโ€™s learn how to **communicate with the user** โ€” using `cin` and `cout`. ๐Ÿ—ฃ๏ธ๐Ÿ’ฌ

In C++,

* `cout` โ†’ displays output on the screen
* `cin` โ†’ takes input from the user

---

# # # ๐Ÿงฉ Example:

```cpp

using namespace std;

int main() {
string name;
int age;

cout > name;

cout > age;

cout

31/10/2025

๐Ÿ’ป C++ Tutorial โ€” Topic 3: Variables & Data Types

Your computer can remember things โ€” like your name, age, or score โ€” but how? ๐Ÿค”
Thatโ€™s where variables come in!

A variable is like a labeled box ๐Ÿ“ฆ where your program stores information temporarily while it runs.

๐Ÿ”น What is a Variable?

Think of it as:

๐Ÿง  A name โ†’ to identify it
๐Ÿ’พ A type โ†’ to define what kind of data it holds
๐Ÿ’ฌ A value โ†’ the actual information stored

๐Ÿ”น Example Code:


using namespace std;

int main() {
int age = 22; // whole number
double price = 49.99; // decimal number
char grade = 'A'; // single character
string name = "Sara"; // text
bool isHappy = true; // true or false

cout

JDoodle - Online Compiler, Editor for Java, C/C++, etc 29/10/2025

๐Ÿ’ป C++ Tutorial โ€” Topic 2: Setting Up C++ (Download & Installation Guide)

Youโ€™ve learned what programming is ๐Ÿ’ก
Now letโ€™s make your computer ready to run your first C++ program! โš™๏ธ

๐Ÿงฐ Step 1: Choose Your Setup Style

You can run C++ in two easy ways:

1๏ธโƒฃ Online (No Installation Needed)
2๏ธโƒฃ Offline (Install an IDE or Compiler)

Letโ€™s see both ๐Ÿ‘‡

๐ŸŒ Option 1: Use an Online Compiler (Recommended for Beginners)

Perfect for learning โ€” no setup, no downloads!
Here are a few trusted sites:

๐Ÿ”น https://www.programiz.com/cpp/

๐Ÿ”น https://www.onlinegdb.com/

๐Ÿ”น https://www.jdoodle.com/c-online-compiler

How to Use:
1๏ธโƒฃ Open the site.
2๏ธโƒฃ Paste your code in the editor.
3๏ธโƒฃ Click Run โ–ถ๏ธ and see the output below!

๐Ÿ’ก Great for mobile users or anyone learning the basics.

๐Ÿ’ป Option 2: Install a C++ IDE (Offline Setup)

If you want to code like a pro โ€” install an IDE (Integrated Development Environment).

Choose one based on your operating system:

๐ŸชŸ Windows Users

โœ… Option 1: Code::Blocks (Beginner Friendly)

Visit: https://www.codeblocks.org/downloads/

Download โ€œcodeblocks-20.03mingw-setup.exeโ€ (includes compiler)

Install โ†’ Open โ†’ Create a new file โ†’ Write your code โ†’ Press F9 to run

โœ… Option 2: Dev-C++

Download from: https://sourceforge.net/projects/orwelldevcpp/

Simple and lightweight!

๐ŸŽ Mac Users

Use Xcode (from the App Store):

Search for โ€œXcodeโ€ โ†’ Install

Open Terminal โ†’ Run:

g++ hello.cpp -o hello
/hello

Youโ€™re good to go! ๐ŸŽ‰

๐Ÿง Linux Users

C++ is often preinstalled!
To check, open your Terminal and type:
g++ --version

If not installed, run:

sudo apt install g++

Then compile your code:

g++ hello.cpp -o hello
/hello

๐Ÿง  Tip:

Always save your file with .cpp extension, e.g.,
๐Ÿ“„ hello.cpp

That tells the computer itโ€™s a C++ file.

๐Ÿš€ Youโ€™re Ready!

Now your system can compile and run C++ programs.
Letโ€™s move on to writing and understanding your first lines of code in the next topic!

JDoodle - Online Compiler, Editor for Java, C/C++, etc JDoodle is an Online Compiler, Editor, IDE for Java, C, C++, PHP, Perl, Python, Ruby and many more. You can run your programs on the fly online, and you can save and share them with others. Quick and Easy way to compile and run programs online.

29/10/2025

๐Ÿ’ป C++ Tutorial โ€” Topic 1: Introduction to Programming

๐Ÿ‘‹ Welcome to the world of Programming with C++!
Programming is simply the art of telling a computer what to do โ€” step by step.
C++ helps us do that efficiently and powerfully. ๐Ÿš€

๐Ÿ”น What is C++?

C++ is a high-performance, general-purpose programming language created by Bjarne Stroustrup.
Itโ€™s used in:

๐ŸŽฎ Game development

โš™๏ธ Operating systems

๐Ÿค– Artificial Intelligence

๐Ÿ’ผ Business software

๐Ÿ”น Why Learn C++?

โœ… Itโ€™s fast and efficient
โœ… It teaches you how computers really work
โœ… Itโ€™s the foundation for many modern languages

๐Ÿ’ก Example: Your First C++ Program


using namespace std;

int main() {
cout

Want your school to be the top-listed School/college in Nowshera?

Click here to claim your Sponsored Listing.

Location

Category

Telephone

Website

Address


Nowshera