DEV Community

Cover image for A Simple C Program I Wrote That Taught Me More Than Tutorials
Tahami AK SERVICES
Tahami AK SERVICES

Posted on

A Simple C Program I Wrote That Taught Me More Than Tutorials

I’ve been learning C for some time now.

At the start, I watched a lot of tutorials.

I understood the concepts… but when it came to writing code myself... Read More

So I decided to try something simple.

The Idea

I wrote a small program:

👉 Take a number from the user and check if it is even or odd.

It sounds very basic, but it helped me understand a lot.

The Code

include

int main() {
int num;

printf("Enter a number: ");
scanf("%d", &num);

if(num % 2 == 0) {
    printf("Even number");
} else {
    printf("Odd number");
}

return 0;
Enter fullscreen mode Exit fullscreen mode

}
What I Learned
1. Taking Input Properly

Before this, I was confused about scanf.

But using it in a real program... Read More

2. Conditions Actually Make Sense Now

I knew what if-else does.

But writing it myself helped me understand when and why to use it.

3. Small Programs Build Confidence

This was not a big project.

But after completing it, I felt more confident.

Final Thought

Sometimes we think we need big projects to learn.

But honestly:

👉 Small programs can teach you more than long tutorials.

If you’re learning C, try... Read More

It really helps.

Thanks for reading.

Top comments (0)