Digital Learning

Monday, November 25, 2019

What is C Language?(elements of C, features, data types):

* C language has been structured and created by Dennis Ritchie at Bell Laboratories in 1972. 

* Why it was named C. The C language is so named on the grounds that its antecedent was called B. The B language was created by Ken Thomson of Bell Labs. 

* C runs under various working frameworks including MS DOS. C programs are proficient, quick and profoundly compact, i.e., C programs composed on one PC can be run on another with next to zero change. 
* It gives circle builds like while, do-while and for.  

Essential Features of C: 


1. Adaptability: 

To offer access to any degree of the PC down to crude machine language, be that as it may, C was planned and along these lines, it is maybe the most adaptable elevated level language. 

2. Intelligently composed Code: 

To sort out projects in a reasonable, simple, legitimate way, C has highlights that permit the software engineer. 
3. Comprehensibility and Simplicity: 
It allows the formation of clean and minimal projects. C is additionally brief. This component can be a blended gift, in any case, and the C software engineer must adjust comprehensibility and straightforwardness. 
4. Productive Resource Handling: 
With C, software engineer can utilize each asset of the PC it offers. C attempts to interface intimately with the neighborhood condition, giving offices to accessing basic peripherals like printers and circle drives. 
5. Significant Level Constructs: 
C offered compact, productive and less grammatical develops. 
6. Productive Programs: 
The projects are productive and compact enough for even framework coding. 
7. Convertibility
Following are the steps used in C programming language. 

1. Character set 

2. C Tokens 
3. Statement
4. Program 

1. Character Set: 
The C character incorporates letters in order of both upper and lower case letters. The C character set is given underneath: 

Nature Symbols 
Letters in order A-Z, a-z 
Numbers 0-9 
Number juggling +-*/%=? 
Sensible !><| and 
Enclosures ()[]{} 
Accentuation :;., 
Uncommon +'"#\^~(blank) 

2. C Tokens: 
By and large content, a word and accentuation marks are called tokens. In C program, the littlest individual units are known as token. 
1. Catchphrases: Following watchwords accessible in C: 


auto               break                         case                singe 

constant       extern                       default          do 

typeof           old                              else                enum             

glide              for                              goto               if 

int                   long                           register         return 

short             marked                    sizeof            static 

struct            switch                       typeof           association 

unsigned     void                           unstable       while 

2. Identifier: An identifier is an arrangement of characters that speaks to an element, for example, a capacity or an information object. 

3. Constants: Constants is a worth that can be put away in the memory and can't be changed during execution of the program. 

Kinds of constants: 
Constants: 
a. Numeric constants 

I. Number constants 
ii. Genuine constants 

b. Character constants 

I. Single character constants 
ii. String constants 

4. Strings: A string is a succession of characters. Strings are put away in memory as ASCII codes of characters that make-up the string annexed with '\0' (ASCII estimation of invalid). Ordinarily each character is put away in one byte, progressive characters are put away in progressive bytes. 


5. Factors: Variable is a named area in memory, i.e., used to hold a worth that can be changed by the program. These factors can take various qualities however each in turn. The estimations of factors can be changed during execution. All the factors ought to be announced before they can be utilized. 


Variable names might be comprises of capitalized character, lowercase character and underscore. 

6. Administrator: An administrator is an image that advises the processor to play out certain numerical or consistent controls. 

Administrators are utilized in projects to control information and factors. The information itself is called 'operand'. 

Administrators subsequently work on operands. C is amazingly wealthy in administrators. It has around 45 distinct administrators. They as a rule structure a piece of numerical or coherent arrangement called articulations. 

Kinds of administrators: 

Contingent upon the capacities played out, the C administrators can be characterized into various classifications. 

They include: 

1. Number juggling administrators 
2. Sensible administrators 
3. Unary administrators 
4. Social administrators 
5. Task administrators 
6. Restrictive administrators 
7. Bitwise administrators. 

1. Number juggling Operators: These administrators for the most part incorporate number-crunching operands. 

expansion + 
subtraction - 
increase * 
division/ 
modulus % 

2. Social Operators: The operands for social administrators are factors, constants or articulations. 

equivalent to = 
not equivalent to != 
more prominent than > 
not exactly < 
not exactly equivalent to <= 
more prominent than equivalent to >= 

3. Intelligent Operators: By utilizing a sensible administrator an articulation assesses to either evident or bogus. 


intelligent and && 
intelligent or || 
intelligent not ! 

4. Task Operators: Assignment administrator accepts the structure as, variable=expression. 

The essential task administrator is =. 

5. Unary Operator: An unary administrator is an administrator that requires just a single operand. For instance, ++, the augmentation administrator, - , the decrements administrator and '!' sensible negator. 

6. Contingent Operator: A ternary administrator pair '?:' is accessible in C to build restrictive articulations of the structure 
exp1?exp2:exp3. 

7. Bitwise Operators: C has a qualification of supporting exceptional administrators known as bitwise administrators for control of information at bit level. These administrators are utilized for testing the bits, or moving them right or left. 

bitwise and 
bitwise OR | 
bitwise elite OR ^ 
move left << 
shfit right >> 

3. Information Types: 

An information type is a translation applied to a series of bits. 

Information type is characterized as a limited arrangement of qualities alongside very much characterized set of decides for activities that can be performed on these qualities. 

Types of Data Types: 
There are four crucial information types in C, which are as per the following: 

1. int: It is utilized to store the whole number worth. 
2. Char: It is utilized to store any single character 
3. Float: It is utilized for putting away decimal numbers. 
4. Double: It is utilized for putting away long scope of decimal numbers.

Some Other Links you may like:

C Programs using while loop and array:                                                                                      

No comments:

Post a Comment