December 2024

getchar(), putchar(), scanf(), printf()

1. getchar() Description: Reads a single character from the standard input (keyboard). Input is buffered, so you need to press Enter after entering the character. Syntax: char ch = getchar(); Example: #include <stdio.h> int main() { char ch; printf(“Enter a character: “); ch = getchar(); // Reads a single character printf(“You entered: “); putchar(ch); // […]

getchar(), putchar(), scanf(), printf() Read More »

Bitwise Operator

Uses of Bitwise Operators Bitwise operators (AND, OR, XOR, NOT, Left Shift, Right Shift) are widely used in various areas of computer science and programming. Here are their practical uses: 1. Bitwise AND (&) Bitwise AND is a simple operation used in computers to compare binary numbers bit by bit. Let’s break it down in

Bitwise Operator Read More »

Header Files in C

Header files in C are files with a .h extension that contain function declarations, macros, and constants. These files are included in a program using the #include directive to access pre-defined functions and symbols. Purpose of Header Files: Provide reusable code for common operations. Enable modular programming by separating declarations and definitions. Reduce redundancy and

Header Files in C Read More »

Expression, Type Conversion and Preprocessor Directives

Expression in C An expression in C is a combination of variables, constants, operators, and functions that are evaluated to produce a result. Types of Expressions: Arithmetic Expressions: Use arithmetic operators (+, -, *, /, %). Example: a + b – c. Relational Expressions: Compare values using relational operators (<, >, <=, >=, ==, !=).

Expression, Type Conversion and Preprocessor Directives Read More »

Operator in C

An operator is a symbol that performs a specific operation on one or more operands (variables or values). Operators are used to manipulate data and variables in a program. Classification of Operators Operators in C are classified into the following categories: 1. Arithmetic Operators Perform basic arithmetic operations. Operator Description Example + Addition a +

Operator in C Read More »