Posts

ARRAYS IN C

Image
Array Concept in C Array Concept in C Understanding Arrays with Examples, Memory Representation, and Operations 📌 What is an Array? An array is a collection of similar data types stored in contiguous memory locations. It allows storing multiple values under a single name, and each value is accessed using an index. int a[5]; // array of 5 integers ⭐ Features of Arrays Stores multiple values of the same data type. Memory is allocated contiguously. Access using an index (starts from 0). Provides random access to elements. Fixed size (decided at compile time). 📝 Declaration & Initialization int marks[5]; int marks[5] = {10, 20, 30, 40, 50}; int marks[] = {10, 20, 30, 40, 50}; ➡️ Accessing Elements printf("%d", marks[0]); // 10 printf(...

Looping statements in c

Looping Statements in C 🔁 Looping Statements in C Loops allow repeating code multiple times until a condition is satisfied. 1️⃣ for Loop 📘 Full Definition The for loop is used when the number of iterations is known in advance. It combines initialization, condition, and increment/decrement in a single line. ⚡ Shortcut: Best for fixed repetitions. 🔹 Syntax: for(initialization; condition; update) { // code to execute } Show Example #include <stdio.h> int main() { for (int i = 1; i 2️⃣ while Loop 📘 Full Definition The while loop is used when the number of iterations is not known in advance. It keeps executing as long as the condition is true. ⚡ Shortcut: Repeat while condition is true. 🔹 Syntax: while(condition) { // code to execute } ...

Conditional statements in C

Conditional Statements in C ✨ Conditional Statements in C Conditional statements help control the flow of a program based on conditions. 1️⃣ if Statement 📘 Full Definition The if statement in C is used to execute a block of code only when a given condition is true. If the condition evaluates to false, the code inside the if block is skipped. ⚡ Shortcut Definition if = Runs code only when condition is true. 📝 Syntax if (condition) { // statements; } Show Example #include <stdio.h> int main() { int age = 18; if (age >= 18) { printf("You are eligible to vote."); } return 0; } 2️⃣ if-else Statement 📘 Full Definition The if-else statement provides two alternative paths of execution. If the condition is true,...

C syllabus for beginners

Image
C Language Syllabus 📘 C Language Syllabus Outline Unit 1: Introduction to C History and Importance of C Structure of a C Program Compilation and Execution Process printf() and scanf() Functions Simple C Programs (Hello World, Sum of Numbers) Unit 2: Operators and Expressions Arithmetic Operators Relational Operators Logical Operators Bitwise Operators Assignment Operators Increment/Decrement Operators Conditional (Ternary) Operator Operator Precedence and Associativity Unit 3: Control Structures if, if-else, nested if-else switch-case statement for loop while loop do-while loop break and continue goto statement Unit 4: Functions in C Definition and Declaration Types of Func...

Quiz on basic c

Image
C Language Mock Test 📝 C Language Mock Test (30 Marks) 1. Who developed the C programming language? Dennis Ritchie James Gosling Bjarne Stroustrup Charles Babbage 2. Which year was C developed at Bell Labs? 1969–1972 1978 1989 1999 3. Which function is the entry point of every C program? main() start() init() begin() 4. Which symbol is used for single-line comments in C? // /* */ # -- 5. Which data type is used to store decimal values? float int char void 6. In C, which keyword defines a constant variable? const constant ...

Operators and expressions

Operators and Expressions in C In C language, operators are special symbols used to perform operations on data and variables. An expression is a combination of operators and operands (variables/constants) that produces a result. Example: a + b is an expression where + is an operator and a , b are operands. 1. Arithmetic Operators These operators are used for mathematical calculations like addition, subtraction, multiplication, etc. Operators: + (Addition), - (Subtraction), * (Multiplication), / (Division), % (Modulus) #include <stdio.h> int main() {   int a = 10, b = 3;   printf("a+b = %d\\n", a+b);   printf("a-b = %d\\n", a-b);   printf("a*b = %d\\n", a*b);   printf("a/b = %d\\n", a/b);   printf("a%%b = %d\\n", a%b);   return 0; } Output: a+b = 13 a-b = 7 a*b = 30 a/b = 3 a%b = 1 2. Relational Operators These operators are used to co...

Shortcuts

Interactive PC Keyboard Shortcuts 🎹 Interactive PC Keyboard Shortcuts For Windows 10 & 11 🔍 Expand All Collapse All ✨ Essentials Action Shortcut Copy Ctrl C Copy Paste Ctrl V Copy Cut Ctrl X Copy Undo Ctrl Z Copy Redo Ctrl Y Copy 🖥 Windows Shortcuts Action Shortcut Open Start Menu Win Copy Open Task Manager Ctrl Shift Esc Copy Open File Explorer Win E Copy Lock your PC Win L Copy Open Settings Win I Copy 🌐 Browser Shortcuts Action Shortcut New Tab Ctrl T Copy Close Tab Ctrl W Copy Reopen Closed Tab Ctrl Shift T Copy Refresh Page F5 Copy Find on Page Ctrl F Copy 📄 MS Word Shortcuts Action Shortcut Bold Ctrl B Copy Italic ...