Temperature Converter

How to build a Temperature Converter in C that can convert between Celsius, Fahrenheit, and Kelvin. This beginner-friendly Bangla tutorial explains the logic step by step and includes full coding examples. Final code #include <stdio.h> // show welcome message to choose conversion option void welcome(){ printf("Select conversion:\n"); printf("1. Celsius to Fahrenheit\n"); printf("2. Fahrenheit to Celsius\n"); printf("3. Celsius to Kelvin\n"); printf("4. Kelvin to Celsius\n"); } int main(){ int selectedOption; float temp; welcome(); printf("Enter your choice:"); scanf("%d", &selectedOption); printf("Enter temperature:"); scanf("%f", &temp); switch (selectedOption) { case 1: printf("Farenheight: %.2f\n", (temp * 9/5) + 32); break; case 2: printf("Celsius: %.2f\n", (temp -32) * 5/9); break; case 3: printf("Kelvin: %.2f\n", temp+ 273.15); break; case 4: if(temp < 0){ printf("Kelvin can not be smaller than 0\n"); }else { printf("Kelvin: %.2f\n", temp - 273.15); } break; default: printf("Invalid choice\n"); } }

Memor leaks

Memory leak happens when create dynamic Memory but doesn’t release :) Means when we don’t use free . int *ptr = malloc(N); // and we don't use `free(ftr)` function Memory Leak A common mistake of Memory leak happens when we create dynamic Memory inside function and forget to free it. void func(){ int *ptr; ptr = malloc(sizeof(*ptr)); /// ..... rest code /// we should free ptr end of its uses. } Reallocation Memory leak We can often forget to free old pointer and set null which is better practice. ...

Currency Converter

Build a Currency Converter in C that can convert between USD, BDT, Gold value, and more! This Bangla tutorial explains the logic step-by-step, shows the full code, and includes a recap to help beginners understand everything clearly. Final code #include <stdio.h> /// show gold price on each currency void calculateGoldPrice(float gram) { double rateBDT = 16028.0; double rateUSD = 131.19; double rateEUR = 113.05; printf("Gold Price for %.5f gram\n", gram); printf("BDT: %.2f\n", gram * rateBDT); printf("USD: %.2f\n", gram * rateUSD); printf("EUR: %.2f\n", gram * rateEUR); } int main(){ int choice; printf("Select conversion:\n"); printf("1. USD to BDT\n"); printf("2. BDT to USD\n"); printf("3. USD to EUR\n"); printf("4. Gold Price\n"); printf("Enter choice: "); scanf("%d", &choice); float amount; printf("Enter amount:"); scanf("%f", &amount); if(amount < 0){ printf("Invalid amount\n"); return 0; } printf("\n"); switch (choice) { case 1: printf("BDT %.2f\n", amount * 120); break; case 2: printf("USD %.2f\n", amount / 120); break; case 3: printf("EUR %.2f\n", amount * .92); break; case 4: calculateGoldPrice(amount); break; default: printf("Invalid input\n"); } return 0; }

Electricity Calculator

How to build a complete Electricity Bill Calculator in C, using a tier-based billing system. In this Bangla tutorial, you’ll understand the logic behind electricity units, slabs, and how to calculate the final bill. Perfect for beginners working on C programming projects! Final code #include <stdio.h> /// calculate bill for a single [tier] float calculateTierBill(float unit, int tierLimit, int rate){ int billedUnit = unit<tierLimit ? unit: tierLimit; return billedUnit * rate; } int main(){ /// bill tiers int tierLimits[] = {50, 75, 100, 200}; int rates[] = {5, 7, 9, 10}; int totalTiers = sizeof(rates) / sizeof(rates[0]); float totalUnits; printf("Enter total used unit: "); if(scanf("%f", &totalUnits)!=1 || totalUnits <0){ printf("Invalid input\n"); return 0; } /// total bill float billed = 0; float remainingUnits = totalUnits; int i=0; while(remainingUnits >0){ float tierBill; if(i< totalTiers){ tierBill = calculateTierBill(remainingUnits, tierLimits[i], rates[i]); float billedUnit = remainingUnits < tierLimits[i]? remainingUnits: tierLimits[i]; remainingUnits -= billedUnit; }else { tierBill = remainingUnits * rates[totalTiers-1]; remainingUnits =0 ; } billed += tierBill; i++; } printf("Billed amount %.2f tk\n", billed); return 0; }

#include<stdio.h>

এই ভিডিওতে আমরা C প্রোগ্রামিং এর সবচেয়ে গুরুত্বপূর্ণ দুটি ফাংশন printf() এবং scanf() সম্পর্কে জানব। ভিডিওতে যা শেখানো হয়েছে: ভিডিওতে যা শেখানো হয়েছে: #include stdio.h C প্রোগ্রামিং এ স্ট্যান্ডার্ড ইনপুট/আউটপুট ফাংশন ব্যবহার করার জন্য দরকার। printf() কিভাবে স্ক্রিনে মেসেজ বা তথ্য দেখানো যায়। সংখ্যা, স্ট্রিং বা ভেরিয়েবল আউটপুট করার উদাহরণ দেখানো হয়েছে। scanf() কিভাবে ইউজার থেকে ডেটা নেওয়া যায়। সংখ্যা বা টেক্সট ইনপুট নেওয়ার সহজ উদাহরণ দেখানো হয়েছে। প্র্যাকটিক্যাল উদাহরণ – একটি ছোট প্রোগ্রাম যেখানে ব্যবহারকারী তার বয়স ইনপুট করবে এবং আমরা স্ক্রিনে দেখাবো।

কেন শুধু Double ব্যবহার করবো না? Data Types, Memory, Float vs Double

এই ভিডিওতে আমরা আলোচনা করবো C Programming Language-এ Data Types নিয়ে। 💻 বিশেষ করে Char, Int, Float, Double কিভাবে কম্পিউটার মেমোরিতে store হয়, তাদের range, precision, bit-size এবং signed vs unsigned কিভাবে কাজ করে সেটা দেখানো হয়েছে। What you’ll learn in this video: Memory & Binary Representation (0 & 1 দিয়ে কিভাবে ডাটা রাখা হয়) Char এর ASCII Value (উদাহরণ: ‘H’, ‘5’) Integer (short, int, long) এর range & storage Float vs Double → precision, bit structure (sign, exponent, mantissa) কেন শুধু Double use করলে সমস্যা হয়? (hardware limitation, efficiency, performance) Long Double & Special Cases Embedded/IoT Device এ Data Type Selection