The screen glowed quietly.
Pran sat frozen in front of the computer.
The last message still stared back at him.
IDENTITY CONFIRMED
SYSTEM INTERACTION ENABLED
NEXT TASK: VERIFY HUMAN AGE
Pran slowly leaned back in his chair.
"Okay…" he said.
"That definitely wasn't in my code."
The computer fan hummed softly.
The cursor blinked again.
_
Waiting.
Patient.
Silent.
Almost like the machine was expecting him to respond.
Pran rubbed his chin.
"Well," he said, "if you want my age… we can do that."
He opened the program again.
Right now the computer could only ask for a name. But it needed to ask for something else.
A number.
Names are text.
But age is different.
Age is a number.
And in C programming, numbers have their own type.
The most common one is called:
int
Which stands for integer.
An integer is simply a whole number.
Examples:
5
12
18
42
100
These are all integers.
Numbers like:
3.14
7.5
9.999
are not integers because they contain decimals.
But ages are whole numbers.
You don't usually say:
"I am 24.7 years old."
Well… unless you are extremely precise.
Pran started typing.
#include
int main() {
char name[50];
int age;
printf("What is your name?\n");
scanf("%s", name);
printf("How old are you?\n");
scanf("%d", &age);
printf("Hello %s\n", name);
printf("You are %d years old\n", age);
return 0;
}
He leaned back.
"Alright computer," he said.
"Let's see if you like numbers."
He pressed run.
The screen displayed:
What is your name?
Pran typed:
Pran
The program continued.
How old are you?
Pran typed:
27
The computer responded:
Hello Pran
You are 27 years old
Pran grinned.
"Nice."
The computer had just stored and printed a number.
Let's break down the important parts.
First we created a variable.
int age;
This tells the computer:
Create a box called age that stores a number.
Just like before, variables are containers.
But this container holds numbers instead of text.
Now look at this line.
scanf("%d", &age);
This tells the computer:
Ask the user to enter a number and store it in the variable age.
The %d means decimal integer.
Basically it means:
Expect a number.
But something interesting appears here.
&age
The & symbol is important.
It tells the computer:
Store the value inside the variable age.
For beginners this might feel strange.
And that's okay.
Even experienced programmers sometimes forget it.
If you accidentally write:
scanf("%d", age);
The program will likely crash or produce errors.
And the computer will basically scream:
"WHAT IS AGE??? WHERE DO I PUT THE NUMBER???"
So always remember:
scanf needs the &
Pran decided to test the program again.
He ran it.
What is your name?
He typed:
Alex
Next:
How old are you?
He typed:
18
The output appeared.
Hello Alex
You are 18 years old
Pran nodded.
"This thing is starting to feel like a real conversation."
He imagined the computer as a robot sitting inside the screen, taking notes.
Robot notebook:
Name: Alex
Age: 18
The robot nodded politely.
"Thank you human."
Pran suddenly had an idea.
"What if the computer could respond differently depending on age?"
But he paused.
"That might be too advanced."
He looked at the mysterious message again.
NEXT TASK: VERIFY HUMAN AGE
"Alright," he said.
"You wanted age verification."
He modified the program slightly.
#include
int main() {
char name[50];
int age;
printf("What is your name?\n");
scanf("%s", name);
printf("How old are you?\n");
scanf("%d", &age);
printf("Hello %s\n", name);
printf("Age recorded: %d\n", age);
return 0;
}
He ran the program again.
What is your name?
Pran typed his name.
Pran
Next question.
How old are you?
He typed:
27
The screen displayed:
Hello Pran
Age recorded: 27
Then the cursor blinked.
Once.
Twice.
Three times.
Then suddenly…
A new line appeared.
A line that Pran definitely did not write.
AGE VERIFIED
Pran slowly leaned closer to the screen.
"Okay… that's getting creepy."
Another message appeared.
ACCESS LEVEL: BASIC USER
Pran's eyes widened.
"Access level?"
Then another message appeared.
SYSTEM MODULE UNLOCKED
Pran sat up straight.
The computer was unlocking something.
The screen flashed briefly.
Then it printed a final message.
NEXT TASK: SECURITY CHECK
Below that message appeared a blinking cursor.
ENTER PASSWORD:
Pran laughed nervously.
"Of course there's a password."
The cursor blinked again.
Waiting.
Silent.
Patient.
Pran cracked his knuckles.
"Alright computer," he said.
"If you want passwords…"
"We're going to need to teach you how to make decisions."
Chapter 4 — The Decision Door ( Preview)
This chapter introduces one of the most important concepts in programming:
You'll learn:
if
else
program decisions
simple password systems
