कम्प्यूटर / Computer

C-language : meaning, characteristics, execution & structure of c program

C-language : meaning, characteristics, execution & structure of c program

C-language

C-language

C-Language

C-Language is a general purpose and structured programming Language developed by ‘Dennis Ritchie’ at AT & T’s Bell Laboratories in 1972’s in USA. It was based on two languages : BCPL, written by Martin Richards, and B, written by Ken Thompson in 1970 for the first UNIX system on a PDP-7. It is a middle level Language. It has the simplicity of a high level language as well as the power of low level language. It means C makes application programs and system programs. It has some various features like control structures, looping statements, arrays, pointes etc.

The programs written in C-language are portable i.e. programs written for one type of computer can be run on another computer.

Characteristics/Features of C

The following are some characteristics of C: Structured language

  1. Extensive use of function calls
  2. Low Level (Bit wise) programming readily available.
  3. Extensive use of pointers for memory, array, structures and functions.
  4. It produces efficient programs.
  5. It can be compiled on a variety of computers.
  6. The C-language is care dependent. The C compiler distinguishes between small letters and capital letters.

Execution of C Program

C program executes in following four steps:

(i) Creating a Program: An editor like notepad or world pad is used to create a program. This file contains a source code which consists of executable code. The file should be saved as ‘*.c’ extension only.

(ii) Compiling the Program : The next step is to compile the program. The code is compiled by using compiler. compiler converts executable code to binary code i.e. object code. The extension of binary code is “*.obj”

(iii) Linking a Program to Library: The object code of a program is linked with libraries that are needed for execution of a program. The linker is used to link the program with Libraries. It creates a file with ‘*.exe’ extension.

(iv) Execution of Program : The final executable file is then run by dos command prompt or by any other software.

Structure of C Program

The basic structure of C program is as follows:
Document Section
Links Section (File)
Definition Section
Global variable declaration Section
Void main C
{                                                                               

Variable declaration section
Function declaration section
executable statements;
}
Function definition section

1. Document Section : It consists of set of comment lines which include name of a program, author name, creation date and other information.

2. Links Section (File): It is used to link the required system libraries or header files to execute a program.

3. Definition Section : It is used to define or set values to variables.

4. Global Variable declaration Section : It is used to declare global or public variables.

5. Void main(): Used to start of actual C program. It includes two parts as declaration part and executable part.

6. Variable declation section: Used to declared private or local variables.

7. Function declation Section : Used to declared functions of program form which we get required output.

8. Executable Statements : Used to give the main logic of required output.

9. Function definition Section : Used to define functions which are to be called from main ().

Example :

/* Program to find factorial of given number */
#include <stdio.h>
int factorial (int n)
void main()

{

int num, fact;
printf (“Enter and integer: “);
scanf(“%d”, & num);
fact = factorial (num);
printf(“Factorial value = %d”, fact);
}
int factorial (int n)

{

int f, i;
f=1;

for (i = 1; i <= n; i#)
f=f*i;
return f;
}

Character set

A character refers to the digit, alphabet or special symbol used to data representation.

  1. Alphabets:  a-z, A-Z
  2. Digits:     0-9
  3. Special characters:   -,@, !, #, $… etc.
  4. White spaces: Horizontal tab, carriage return, New line etc.

Identifier : Identifier is the name of a variable that is made up from combination of alphabets, digits and under score.

Keywords: Keywords are the system defined identifiers. All keywords have fixed meaning that do not change. White spaces are not allowed in key words. Keywords may not be used as an identifier. It is strongly recommended that keywords should be in Lower case letters. There are totally 32 Keywords used in C programming.

struct int float double long register extern static
size shot signed unsigned const type def enum return
case if else switch break goto union auto
valatile default do while for void char

continue

Conclusion: This provides us the information of C-language, features of C, execution of C program and structure of C program.

RELATED QUESTION & ANSWERS

1. When C-language was developed?
Ans: C-language developed by Dennis Ritchie at AT & T’s Bell laboratories in 1972 in USA.

2. In which Extension, source code of a C-program is stored?
Ans: *.c extension is used to store the source code of a C-program.

3. How many steps are used to execute a C-program?
Ans: The following steps are used to execute a C-program.
(i) Creating program
(ii) Compiling program
(iii) Linking program
(iv) Executing program

4. How many Keywords are available in C-language?
Ans: There are 32 keywords used in C-language.

5. Is we can use a keyword as an identifier in our program?
Ans: No, it is not possible to use keyword as an identifier in a C-program.

Important Links

William Wordsworth as a Romantic Poet

William Wordsworth as a poet of Nature

William Wordsworth Biography

William Collins Biography

John Dryden Biography

Alexander Pope Biography

Metaphysical Poetry: Definition, Characteristics and John Donne as a Metaphysical Poet

John Donne as a Metaphysical Poet

Shakespeare’s Sonnet 116: (explained in hindi)

What is poetry? What are its main characteristics?

Debate- Meaning, Advantage & Limitations of Debate

Sarojini Naidu (1879-1949) Biography, Quotes, & Poem Indian Weavers

Charles Mackay: Poems Sympathy, summary & Quotes – Biography

William Shakespeare – Quotes, Plays & Wife – Biography

Ralph Waldo Emerson – Poems, Quotes & Books- Biography

What is a lyric and what are its main forms?

Disclaimer

Disclaimer:Sarkariguider does not own this book, PDF Materials Images, neither created nor scanned. We just provide the Images and PDF links already available on the internet. If any way it violates the law or has any issues then kindly mail us: guidersarkari@gmail.com

About the author

Sarkari Guider Team

Leave a Comment