Flowchart & Syntax

Logic + Rules of Coding

What is a Flowchart?

Definition :-

A flowchart is a visual representation of steps involved in solving a problem.

 

Simple meaning:


Flowchart is a blueprint of a program.

Just like engineers draw a building plan before construction,
programmers draw a flowchart before coding.

It uses standard symbols and arrows to show how a process moves from start to finish.

 Before writing any program, we first plan the logic.
 Flowchart helps us see that logic clearly.

Why Do We Use Flowcharts?

Flowcharts are important because:

They make logic easy to understand
They reduce confusion while coding
They help identify mistakes early
They improve problem-solving skills
They make explanation easier during interviews or presentations

Golden Rule of Programming:


        Think First → Draw Second → Code Last

 

If logic is clear, coding becomes simple.

Basic Flowchart Symbols

Symbol Name Purpose
🔵 Oval Start / End Beginning or finishing point
▭ Rectangle Process Any calculation or action
◇ Diamond Decision Condition checking (Yes/No)
▱ Parallelogram Input/Output Taking input or showing output
➡ Arrow Flow Line Direction of process

NOTE:-

Every symbol has meaning.
We cannot randomly draw shapes.
Standard symbols make flowcharts universally understandable.

 Example – Even or Odd Number 

Let’s understand a simple program using flowchart logic.

 

Steps:

Start

Take a number as input

Check: Is number divisible by 2?

If Yes → Print “Even”
If No → Print “Odd”

End

This diamond shape is very important.

It checks a condition.

Programming always depends on conditions.

Real-Life Flowchart Examples

🏧 ATM Machine Logic

Start

Insert Card

Enter PIN

Is PIN Correct?
Yes → Select Amount → Withdraw Cash → End
No → Show Error → End

 

ATM never gives money without checking condition.

 

Same way, programs check conditions before giving output.

What is a Syntax?

Now after planning logic, we write actual code.

Definition :-

    Syntax is the set of rules that define how a programming language must be written.

Syntax = Grammar of Programming Language

Without grammar, sentences become wrong.
Without syntax, programs give errors.

Just like English has grammar rules,
Java, Python, C all have syntax rules.

Why is Syntax Important?

Syntax are important because:

✔ It helps compiler understand your code
✔ It prevents compilation errors
✔ It ensures proper execution
✔ It improves readability
✔ It maintains coding discipline

Important Concept:
         Wrong Syntax = Compilation Error

 

Compiler is strict.
It does not guess what you mean.
It only follows rules.

Syntax Example in Java

 Correct Syntax

int a = 10;
System.out.println(a);

JAVA

Incorrect Syntax

int a = 10;
System.out.println(a)

JAVA

Why wrong?

❌ Missing semicolon
❌ Statement not properly terminated

Also remember:

Java is case-sensitive.

System.out.println("Hello"); ✅
system.out.println("Hello"); ❌

Small mistake → Big error.

Flowchart vs Syntax

Flowchart Syntax
Used for planning Used for writing code
Focuses on logic Focuses on rules
Done before coding Done during coding
Prevents logical errors Prevents compilation errors

Flowchart = Clear Thinking
Syntax = Correct Writing

Both are equally important.

Flowchart & Syntax

By Content ITV

Flowchart & Syntax

  • 0