Category: C Tutorial

C Logical Operators in Conditions 0

C Logical Operators in Conditions

1. What are Logical Operators? Logical operators are used to evaluate true/false conditions. In C, the main logical operators are: Operator Symbol Description AND && True if both conditions are true OR ` NOT...

C If … Else 0

C If … Else

1. What is if…else? The if…else statement allows your program to execute certain code only if a condition is true, and optionally another block if the condition is false. Syntax: if (condition) { //...

C Booleans 0

C Booleans

1. What is a Boolean? A Boolean represents truth values: True → 1 False → 0 Used in conditional statements, loops, and logical operations. Note: C does not have a built-in bool type in...

C Operators 0

C Operators

1. What are Operators in C? Operators are symbols that perform operations on operands (variables or values). C supports many types of operators for arithmetic, comparison, logical, bitwise, assignment, and more. 2. Types of...

C Constants 0

C Constants

1. What is a Constant? A constant is a fixed value that cannot be altered by the program once defined. Useful for values like pi, tax rates, maximum limits, or configuration values. 2. Types...

C Type Conversion 0

C Type Conversion

1. What is Type Conversion? Type conversion is the process of converting a value from one data type to another. C supports two types of conversions: Implicit Conversion (Type Promotion) Explicit Conversion (Type Casting)...

C Extended Types 0

C Extended Types

1. What are Extended Data Types? Extended types are variations of basic data types used to store larger ranges of values or specific types of data. They include: long int / long long int...

C Data Types Examples 0

C Data Types Examples

1. Integer Data Type (int) #include <stdio.h> int main() { int age = 25; int year = 2025; printf(“Age: %d\n”, age); printf(“Year: %d\n”, year); return 0; } Output: Age: 25 Year: 2025 2. Floating-Point...

C The sizeof Operator 0

C The sizeof Operator

1. What is sizeof? sizeof is a compile-time operator in C. It returns the size (in bytes) of a data type, variable, array, or structure. Syntax: sizeof(variable_or_data_type) The result is usually of type size_t...

C Decimal Precision 0

C Decimal Precision

1. Floating-Point Numbers in C float → single-precision decimal numbers (4 bytes) double → double-precision decimal numbers (8 bytes) By default, printing a float/double may show many decimal places. To control precision, we use...