🔵 Day 3 – My First C Program to Calculate Area of a Circle
Today marks another exciting step in my coding journey. After writing simple introductory programs in Python and C, I finally wrote my first program that solves a real problem in C — calculating the area of a circle.
🧩 The Program {}
#include <stdio.h>
int main()
{
/*
Program : C program to find area of circle
Author : Mayur B Gund
Date : 7 Sep 2025
*/
char r; // character for radius
int b; // integer for radius value
scanf("%c\n", &r); // input for character
scanf("%d", &b); // input for radius value
printf("The area of circle \nwith radius %c = %dcm is \n\t: %f sqcm\n\n",
r, b, 3.14 * b * b);
printf("This program calculates area \nof circle with 100 percent\n accuracy\n");
printf("\tNote: Radius should\n be an integer.");
return 0;
}
📌 Output : 🖥
The area of circle
with radius r = 432cm is {r and 432 are user inputs}
: 585999.360000 sqcm
This program calculates area of circle with 100 percent accuracy
Note: Radius should be an integer.
💡 What I Learned Today
- How to take inputs from the user using scanf.
- Using variables (char + int) together in one program.
- Applying a mathematical formula in C.
- Formatting output clearly with printf.
🚀 Reflection
Compared to my first two programs, this one feels more practical and powerful. It gave me a sense that I’m moving closer to solving real-world problems with code.
- Learning Python 🐍 and C ⚙️ side by side is helping me balance:
- Python → simplicity and fast results.
- C → strong fundamentals and deeper understanding.
Step by step, I’m building a stronger foundation for my programming journey. 🌟
![]() |
| Area Calculator using C Language |
Also read :
👨💻 Writing My First C Program – A Step Deeper into Programming
🌟 A Small Beginning, A Big Step Forward 🌟
New Journey Begins : Undergraduate Computer Engineer
Mayur’s Tech Journey ; From Village to Virtual: My Code for Change

Comments
Post a Comment