Read & Write file

Write Files আমরা জানব fopen(), fclose(), fscanf(), এবং fprintf() ফাংশনগুলো কীভাবে ব্যবহার করতে হয়। ফাইল ওপেন এবং ক্লোজ fopen() ফাইল ওপেন করার জন্য। fclose() ফাইল ক্লোজ করার জন্য। fopen() এর সিঙ্কট্যাক্স: FILE *fp = fopen("filename.txt", "mode"); mode হতে পারে: r - পড়ার জন্য w - লেখার জন্য (ফাইল থাকলে ওভাররাইট হবে) a - যোগ করার জন্য (append) ফাইল থেকে পড়া: fscanf() fscanf() ব্যবহার করে ফাইল থেকে ফরম্যাটেড ডেটা পড়া যায়। ...

Calculator

A beginner-friendly C project where you’ll learn to build a Calculator using switch and functions. Covers input handling, operator-based execution, and error fixing - everything explained clearly in Bangla. First example code without while #include <stdio.h> /// Function prototypes float add(float a, float b); float subtract(float a, float b); float multiply(float a, float b); float divide(float a, float b); int main() { float a, b, result; char op; printf("Enter a:"); scanf("%f",&a); printf("Enter b:"); scanf("%f",&b); printf("Choose operation(+, -, *, /):"); scanf(" %c", &op); switch (op) { case '+': result = add(a, b); break; case '-': result = subtract(a,b); break; case '*': result = multiply(a,b); break; case '/': result = divide(a,b); break; } printf("%.2f %c %.2f = %.2f\n", a, op, b, result); return 0; } float add(float a, float b){ return a + b; } float subtract(float a, float b){ return a - b; } float multiply(float a, float b){ return a * b; } float divide(float a, float b){ return a /b; } Validate number(float) if(scanf("%f",&a) != 1){ printf("Invalid input\n"); return 0; } validate operator if (op != '+' && op != '-' && op != '*' && op != '/'){ printf("Invalid operation\n"); return 0; } Final code #include <stdio.h> // Function prototypes float add(float a, float b); float subtract(float a, float b); float multiply(float a, float b); float divide(float a, float b); int main() { float num1, num2, result; char op; while (1) { // Input numbers printf("Enter first number: "); scanf("%f", &num1); printf("Enter second number: "); scanf("%f", &num2); // Display menu printf("\nChoose operation (+, -, *, /, = to exit): "); scanf(" %c", &op); // space before %c to skip whitespace if (op == 'q') { printf("Exiting program.\n"); break; } switch (op) { case '+': result = add(num1, num2); printf("Result: %.2f\n", result); break; case '-': result = subtract(num1, num2); printf("Result: %.2f\n", result); break; case '*': result = multiply(num1, num2); printf("Result: %.2f\n", result); break; case '/': if (num2 != 0) { result = divide(num1, num2); printf("Result: %.2f\n", result); } else { printf("Error: Division by zero!\n"); } break; default: printf("Invalid operation! Try again.\n"); } printf("\n"); // Extra line before next iteration } return 0; } // Function definitions float add(float a, float b) { return a + b; } float subtract(float a, float b) { return a - b; } float multiply(float a, float b) { return a * b; } float divide(float a, float b) { return a / b; }

Triangle Patterns in C

Star Triangle Left Triangle #include <stdio.h> int main() { int n ; printf("Enter Number of rows:"); scanf("%d", &n); for(int i=1; i<=n;i++){ for(int j=1; j<=i; j++){ printf("%c",64+j); } printf("\n"); } return 0; } In C, braces { } group multiple statements into a block. You can skip them for a single statement, but using { } is safer and improves readability. ...

Dynamic Memory Allocation

Why do we need dynamic memory When we create variable it uses static memory. The size uses before running the program. Sometimes we don’t even know what the size will be. And we can use dynamic memory. Dynamic memory is memory that is allocated after the program starts running. ...

Pointer

pointer কী আমরা আলোচনা করব pointer কী, pointer দিয়ে variable update করা, এবং memory address কিভাবে কাজ করে। সহজ উদাহরণ ও code explanation সহ। Beginners এর জন্য একদম clear guide। Pointer vs Address এই ভিডিওতে আমরা memory address, pointer ব্যবহার এবং মান অদলবদল করার পদ্ধতি সহজ উদাহরণসহ দেখিয়েছি। Beginners এর জন্য একদম সহজ ও পরিষ্কার ব্যাখ্যা। ...

Structures

Structure ? Structure Pointer ভিডিওতে দেখানো হয়েছে multiple struct instances, array of structs, এবং step by step code examples। Nested Structures Structs Inside Structs ...

Union

Union কী, কিভাবে কাজ করে এবং Struct এর সাথে পার্থক্য। ভিডিওতে দেখানো হয়েছে union creation, memory visualization, size comparison, padding, alignment এবং practical union examples। Beginners এবং self-learners এর জন্য সহজ ব্যাখ্যা।

Array [part 1]

Array define করা, value input নেওয়া, dynamic array এবং index vs length step by step।

Function

Functions কে animatedভাবে দেখিয়েছি, যা beginners-এর জন্য খুবই সহজে বুঝতে সাহায্য করে। ভিডিওতে আপনি শিখবেন: Function define করা Function ব্যবহার করা (Use) Return value বোঝা Pass value / Argument passing Sum calculation উদাহরণ

Conditions

if, if-else, else-if & Nested Conditions, switch, break, continue এই ভিডিওতে আমরা শেখব if, if-else, else-if এবং Nested if কীভাবে ব্যবহার করতে হয়। ভিডিওতে থাকছে: Conditional statements দিয়ে decision making Pass/Fail check করার জন্য logic তৈরি করা A+ grade চেক করা এবং flow diagram অনুযায়ী program structure Nested if এবং multiple condition কিভাবে handle করতে হয় Switch Case condition কিভাবে একাধিক শর্ত পরীক্ষা করে কোড কার্যকর করা যায়, এবং প্রতিটি পরিস্থিতির জন্য আলাদা কোড ব্লক ব্যবহার করা যায় তা উদাহরণ, pseudocode, এবং flow-diagramের মাধ্যমে দেখানো হয়েছে। ...