Names of Special Symbols used in C language
- Get link
- X
- Other Apps
Names
of Special Symbols used in C language
- Knowledge Canvas
The C language one of the most popular languages and also is a high-level computer programming language. C is a language because it has a vocabulary and sets of grammatical rules for instructing a machine to perform a specific task. As C is a language for communicating with the machine it must have some special symbols. In programming, language symbol is a primitive data type whose instances have a special meaning and a unique human-readable form. C language use some Predefined(meaning already known to the compiler) symbols like keyword, special characters, etc.
If we divide the special
symbols that are used in C programming language then there will be two parts –
- Firsts is the keywords and
- The
second is the special characters
These two are the most popular parts
regarding the special symbol of the C programming language. Let’s discuss these two
parts in detail.
If you want to learn more about the C programming language then you can follow the tutorials of this channel - Programming Cloud
i) Keywords:-
C has some special, predefined
reserved word with a special meaning to the compiler known as a keyword. There
are 32 keywords in ANSI C. Keywords are must be written in lower case because C
is case sensitive language. I will try to briefly describe the 32 keywords and
their meaning...
1)
auto:-
auto is the keyword of
declaring the automatic variable. auto is the default storage class which defines a
local variable with a local lifetime within a function or block.By default all
variable within a fiction or block is auto so auto is rarely used while writing
C program.
2)
break:-
break keyword is used to
terminate the switch statement and it is also terminate the inner loop
immediately when a break is encountered.
for (i=1;i<=10;++i)
{
if (i==4)
continue;
if (i==9)
break;
printf("%d ",i);
}
3)case:-
the case is used for decision
control program structure. The case is used for the switch case statement.
4)
char:-
char is a character data type
which is used during variable declaration.
5)
continue:-
It is used inside for, while,
do-while loop for skipping the execution of code and passes control to the next
iteration.
6)
do:-
It is only used with while in
do-while loop.
7)
default:-
The default keyword is used in
two field in C language-
i) Switch case:- It is
used as the declaration of the default case label.
ii) Type:- generic
expression:--used as the declaration of
default generic association.
8)
const:-
By using the const keyword, an identifier can be declared as constant.
const int a = 10;
9)
double:-
It is used to define a variable
that can store a floating-point value during variable declaration.
10)
else:-
It is used with if during
decision making.
if (i == 10)
printf("i is 10.");
else
printf("i is not 10.");
11)
enum:-
By using enum keyword we
declare enumeration data type which is the sets of constant.
enum
week{Mon=10, Tue, Wed, Thur, Fri=10, Sat=16, Sun};
enum day{Mond, Tues, Wednesday, Thurs,
Frid=18, Satu=11, Sund};
12)
extern:-
The extern keyword extends the
visibility of C variable and C function.
13)
for:-
using this keyword we written
for loop in c language.
14)
if:-
This keyword is used for
decision-making statement.
Learn -- Conditional Statements
15)
goto:-
This keyword provides
unconditional jump to a specified label
in the same function in C programming.
for(i=1; i<=5; ++i)
{
if
(i>5)
goto
error;
}
printf("i is 5 or less than
5");
error:
printf("Error, count is greater
than 5.");
16)
float:-
It is used to define a variable
that can store a floating-point value during variable declaration.
17)
int:-
It is used to define a variable
that can store an integer value during variable declaration.
18)
long:-
It is used to define a variable
that can store an integer value with range -2147483648 to 214743648 during
variable declaration.
Learn -- Data Types in C Programming Language
19)
register:-
To create a register variable we
use the register keyword. The variable store in the CPU register so it is faster than
normal variable.
20)
return:-
To terminate a function we use
return keyword and returns a value.
21)
signed:-
It is a type modifier which
make a variable represent positive as
well as a negative value. The range of signed int is 32768 to 32767.
22)
static:-
we can declare a variable static
by using the static keyword. Even after out of their scope a static variable can
preserve its value.
static int variable;
23)
sizeof:-
The sizeof keyword can
calculate the size of a data like variable or constant.
24)
short:-
It is a type specifier with the
range -32768 to 32767. It stores a short integer value.
25)
struct:-
The Structure data type is
defined by the struct keyword. The Structure is a user-defined composite data
type in C language which allows us to store data of different type-together.
26)
switch:-
By this keyword, we write switch
statement which is a selection control mechanism that allows a variable to test
for equality against a list of values.
27)
typedef:-
The typedef keyword is used to
create an additional name for another data type but do not create a new type.
28)
union:-
This keyword is used to create
a special data type that store different data types in the same memory
location called union. The union can be defined by many members.
29)
void:-
It is a return type which
return nothing.
30) while:-
This keyword is used for a while
loop. It is an entry control loop.
Learn -- Loops or Iterators in C
31) volatile:-
The volatile keyword is used on a
variable when it is declared. This keyword actually tells the compiler that the
value of the variable may change at any time.
32)
unsigned:-
It is a type modifier which
make a variable only represent zero and a positive integer. Range of unsigned int
is 0 to 65535.
ii) Special
Characters in c:-
In C language we use many
special character and each character has a special meaning which already known
to the compiler.
1.
Hash (#):-
# is
known as Pre-processor directive. It is used to include the library
function which is a process before the main
function. As # is the highest priority in the computer system, we use it as
Pre-processor directive.
2.
Ampersand (&):-
This is used as the address of the operator. It is also known as bitwise and operator.
3.
Percent (%):-
i) % is used as a modulo operator.
ii) It is also used
before the format specifier.
4.
Asterisk (*):-
i) Use
as an operator for multiplication.
ii) Also used for a
pointer.
5.
Exclamation mark (! ):-
It is known as logical NOT
operator.
6.
Tilde (~):-
Bitwise NOT operator.
7. Carret (^):-
Bitwise XOR operator.
8.
Semicolon (;):-
It is used as a terminator in C
language.
9.
Vertical bar (|):-
Bitwise OR operator.
10. Parentheses or ():-
Generally, parentheses indicate
a function.
11. Curly Braces or {}:-
Braces used to define the scope
of a block.
12. Square Bracket or []:-
These brackets are generally
used to define arrays.
13.
Logical OR(||):-
This is basically used to
perform an “OR” operation. This symbol especially works exactly the same as the OR gate
used in digital electronics.
14.
Logical AND(&&):-
This is basically used to
perform the “AND” operation. This symbol especially works exactly the same as the AND
gate used in digital electronics.
Learn -- Operators in C
The C programming language is one
of the most popular and basic programming languages that have salient features
along with the symbols (consists of both Keywords and Symbols) that really help
programmers to code in a more efficient way. Hence these special symbols are the inseparable part of this C programming language.
You
may also read - Which Programming Language Should You LearnFirst As A Beginner
- Get link
- X
- Other Apps
Comments
Post a Comment