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; }

কেন শুধু 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