Basic Commands of C Language - C language ki basic commands - C commands kya hoti hai - What is Commands in C Language
Basic Commands of C Language
In C, there are several basic commands or language
constructs that are used for programming. These commands perform various
operations, control the flow of execution, and manipulate data. Here are some
of the fundamental commands in C:
Comments:
// Single-line comment: Used to add comments on a single
line.
/* Multi-line comment */: Used to add comments spanning
multiple lines.
Variables and Data Types:
Declaration: Used to declare variables and specify their
data types.
Assignment: Used to assign values to variables using the assignment
operator (=).
Input and Output:
printf(): Used to print formatted output to the console.
scanf(): Used to read input from the user.
Control Structures:
if-else: Used to perform conditional execution based on a
condition.
switch-case: Used to perform multi-way branching based on
different cases.
for loop: Used for iterative execution of a block of code
with a specified number of iterations.
while loop: Used for repetitive execution of a block of code
as long as a condition is true.
do-while loop: Similar to a while loop but ensures that the
block of code executes at least once.
Functions:
Function definition: Used to define functions that perform
specific tasks.
Function call: Used to invoke a function and execute its
code.
Arrays:
Declaration: Used to declare arrays to store a collection of
elements.
Accessing elements: Used to access and modify individual
elements within an array.
Pointers:
Declaration: Used to declare pointer variables that store
memory addresses.
Dereferencing: Used to access the value stored at a memory
address pointed to by a pointer.
Pointer arithmetic: Used to perform arithmetic operations on
pointers.
Control Flow:
break: Used to exit from a loop or switch case statement.
continue: Used to skip the current iteration of a loop and
continue to the next iteration.
These are some of the basic commands in C. By combining
these commands, you can create more complex programs and perform a wide range
of operations. It's important to understand these fundamental commands as they
form the building blocks of C programming.
Comments
Post a Comment