CSE SOLUTION SITE



Programming Language C Question List | Solve

About C Language

About C Language


'C' Programming Language was developed by Dennis Ritchie at AT & T Bell laboratories in 1972. this is general purpose, compiled, structured programming language. Dennis Ritchie studied the BCPL, then improved and named it as 'C'. The C programming language Brian Kerninghan and Dennis Ritchie in 1978. American national Standards Institute(ANSI) approves a version of C in 1989 which is known as ANSI C.


Importance of C Language

Importance of C Language


* It has a rich set of built-in functions and operators that can be used to write any complex program.

* C compiler combines the capability of an assembly language with the features of high level language. Therefore well suited for writing both system-software and business-packages.

* Program written in C are efficient and fast due to its variety of data types and powerful operators.

* C is highly portable i.e. C program written for one computer can be run on another computer with little or no modification.

* Its modular structure makes program - debugging, testing and maintenance, easier.



Why C is high - level Language?

** We know that a high-level language has some characteristics such as :


It is easy to understand

It is similar to English, therefore, it is easier to learn.

It has rich sets of built in functions.

It takes less executing time, etc.

As C has those characteristics, so we can say "C is high level language".



Why C is Mid-level Language?

** Middle Level Language :


Middle Level Languages are closely related to Machine as well as Human Being.
C is middle level Language.

Cause C is Middle Level Language :

C supports inline Assembly Language Programs.

In Assembly Language direct access to system Register is given so Assembly is Machine Dependent.

C also supports high Level Language Features.

It is more User friendly as compare to Previous languages. So, C is Middle Level Language.



Why C is system Programming Language?

C is called system Programming Language, because -


## C compiler has characteristics of an assembly language with features of high level language. This characteristics makes C program as a easy and well designed programming language.

## By using this language we can work in bit level language which is the main concept of system software. C supports mathematical and logical statements which are very important for system software. It can make an relation between high level languages and how level language that makes easy process to write system software.


What are the Main Features of C Language?

The Main Features of C Language :


C is a general purpose language i.e. it can be used for any type of programming solution.

It is a structured programming, so it provides a disciplined approach to write the program.

It has high-level constructs, which gives users the programming efficiency

It can handle low level language, which gives the machine efficiency.

It has a rich set of built-in functions and operators that can be used to write any complex program.

C compiler combines the capability of an assembly language with the features of high level language. Therefore well suited for writing both system-software and business-packages.

Program written in C are efficient and fast due to its variety of data types and powerful operators.

C is highly portable i.e. C program written for one computer can be run on another computer with little or no modification.

Its modular structure makes program- debugging, testing and maintenance, easier.


Different Forms of main() Statement

**C permits different forms of main statement. The following forms are followed :


main()
main(void)
int main(void)
void main()
void main(void)
int main(void)


main() and main(void)

The empty pair of parentheses main() and also the main(void) indicates that the function has no argument.

int main()

The statement int main() indicates that the function returns an integer value to the operating system.

void main()

The statement void main() indicates that the function does not return any information to the operating system.

void main(void)

The statement void main(void) indicates that the function does not return any information to the operating system and it has no argument.

int main(void)

The statement void main(void) indicates that the function return any integer value to the operating system and it has no argument.


Why do we need a main() in a C program?

we need a main() in a C program :


Main() is a special function in a C program that makes the beginning of the program.C isn't a library function.It is a user dfined function.Every A program must have exactly main() function use more than one main() function, the compiler can't understand the beginning of the program


What are the types of characters used in C

The types of characters used in C :


  • (a). Letters. Examples are 'A', 'B', 'C'

  • (b). Digits. Examples are '0', '1', '2'

  • (c). Special Characters. Examples are '$', '#', '.....'

  • (d). White Spaces. Examples are '\n'



What is Trigraph?

Trigraph :


In C, trigraphs are sequences of three characters which are interpreted as one character by tyhe language.
Each Trigraph sequences consists of three characters, two question markes followed by another character the C processor replaces all occurances of the equivalents before any processing.
Example : ?? = i the equivalent of and ??? is not a Trigraph sequence.


Why do we need Trigraph in C?

we need Trigraph in C :


  • (1). Keyboards may not have keys to convert the entire character set of the language

  • (2). Input of special character may be difficult

  • (3). Text editions may reseur some characters for special use.

  • (4). Trigraphs might also be used for some EBCDIC code pages that lock characters such as {and}, and so on.


What is identifiers?

Identifiers :


An identifier is a user-defined name given to an item such as functions, labels and variables
Example : int - myvar;
Here, -myvar is an identifier which is uesed as a variable - name.


What are Keyword?

Keyword :


Keywords are words reserved by C that have fixed meanings and those meanings can not be charged when combined with C syntax, they form a c program.
We can not have idntifier name same as a C keyword that is why they are called reserved words.
Accordings to C(98) standard.There are 32 keywords in C and in C99 therea are 37 keywords that is , C99 adds five new keywords to the original language.
Exampel :int - is a keyword and it is used to declare a variable that can only hold integer language.


What is variable?

Variable :


A variable is an identifier that occupies a memory location to store a data value and unlike constants can take
different values. Example : int x = 0;
In this statemen, x is a variable whose types is integer and value is 0.


What is a user-defined type?

A user-defined type :


A user-defined type is a data declared by the user.
In C , user defined types are declared by using two keywords typedef and enum.

© Copyright & reserved CSE Solve