Programming Languages

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

 # # # **📘 C++ – Introduction to Functions (With Example)**In C++, **functions** help you write cleaner, reusable, and m...
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

 # # 💻 **C++ Tutorial — Topic 8: Switch Statement (Multiple Choices Made Easy)**Sometimes your program needs to choose f...
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

Topic # 7: Level Up Your Logic — Loops in C++ 🔁After mastering Decision Making, it’s time to make your code repeat smart...
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

💻 **C++ Tutorial — Topic 6: Decision Making with if-else Statements**So far, your programs can *calculate* — but can the...
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

Shout out to my newest followers! Excited to have you onboard! Haroon Irfan Kahout King, Mueez Ahmad, M Inam Tabasum, Na...
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

💻 **C++ Tutorial — Topic 5: Operators in C++**Now that we can take input and display output,let’s learn how to **process...
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:** `== != > < >=

💻 **C++ Tutorial — Topic 4: Input & Output in C++**Now that we know how to store data using variables,let’s learn how to...
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

💻 C++ Tutorial — Topic 3: Variables & Data TypesYour computer can remember things — like your name, age, or score — but ...
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

💻 C++ Tutorial — Topic 2: Setting Up C++ (Download & Installation Guide)You’ve learned what programming is 💡Now let’s ma...
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 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.

💻 C++ Tutorial — Topic 1: Introduction to Programming👋 Welcome to the world of Programming with C++!Programming is simpl...
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

Address

Nowshera

Telephone

+923161922232

Website

Alerts

Be the first to know and let us send you an email when Programming Languages posts news and promotions. Your email address will not be used for any other purpose, and you can unsubscribe at any time.

Contact The School

Send a message to Programming Languages:

Shortcuts

Share

Category