C-Programming Basics . Chapter 1

0

Chapter 1

C-Programming Basics.

 

Introduction 

A language is medium of exchanging views, and thoughts . in other word to communicate with other people we used the natural language like English, Hindi, Punjabi, Tamil etc .the same way, solving the problem using a computer, some programming  language are used . now you think what is program . A program is a set of instruction , arranged in particular order to solve the given problem. program is used for translate to the english language to binary language before execution .

the history of c programming is so long, initially ,i.e. in 1940's only the machine language (binary language) or low level language was used to given instructions to the computer . low level language means (0,1) because in this language only we have two digits. so its called low level language. Binary language (low level language) executes the program is so fast but difficult to understand.

After that Assembly language come into being .it is easy to understand but it written for one microprocessor does not work on another microprocessor. 

In 1960's Martin Richard developed a language called BCPL (Basic combined programming language) , soon after that Ken thompson developed a language called B.  then In 1972 Dennis Ritche at AT & T's Bell laboratories in USA  succeed to develop a good and powerful language is called C. 

Characteristics of C Language:

  • clearity
  • Efficiency
  • Case Sensitive Language
  • Portability
  • Compact Code
  • modularity
  • Lesser number of keywords
  • C language allows
General Structure of C program
  1. Documentation Section 
  2. Preprocessor Directives
  3. Global Declaration 
  4. main () function 
            {
                statements 
                   non statements
             }
  1.  user defined function 
Documentation Section : The documentation section comprises of a bunch of remark lines giving the name of the program, the creator, and different subtleties, which the developer might want to utilize later. We can likewise call this segment the remarking area. eg: /* the program to check whether */

Preprocessor Directives : In this section preprocessor directives is used for call the directives. for eg. #include<stdio.h> in this segment '#' is the call function. and stdio.h is standard input out or the location of file 'h' is called header file . so it means call the header file that name is standard input or output. 

Global Declaration Section : This section is optional . the variables declared in this section are shared among function with in a program. 

main( ) function :  this section is necessary  .Execution of every C program begins main ( ) function is are used because main () function is declare the code we used after the { braces is the main part of the program . 

User defined Function : This section is also optional. here user defined the problems. 

if you want any example of c program click here (Link :  hello world program )

                        ERRORS IN C

No one can perfect write a C program. every one make mistakes to write a program , this mistakes are called errors or bugs . to finding those errors is called debugging.

types of errors commonly finding in C
  1. Syntax Errors
  2. Logical Errors
  3. Run Time errors
  4. Linker Errors
 People also ask these questions:

Who developed C language
In 1972 Dennis Ritche at AT & T's Bell laboratories in USA  succeed to develop a good and powerful language is called C.



Why C Language is named so
It was named 'C' on the grounds that a large number of its elements were gotten from a previous language called 'B'.


What do you mean by Compiler 
A compiler is an exceptional program that interprets a writing computer programs language's source code into machine code, bytecode or another programming language. The source code is normally written in an undeniable level, comprehensible language like Java or C++


What does BCPL stands for 
BCPL is stands for basic combined programming language


What does IDE stands for 
IDE stands for integrated development environment 


What do you mean by L-value
L-value: "l-value" alludes to memory area which distinguishes an item. l-worth might show up as either left hand or right hand side of a task operator(=). l-value frequently addresses as identifier. Articulations alluding to modifiable areas are classified "modifiable

What do you mean by r-value
R-value: r-value" alludes to information value that is put away at some location in memory. A r-value is an articulation, that can't have a worth doled out to it, and that implies r-worth can show up on right yet not on left hand side of a task operator(=).

What is difference between 'X' and "X"
In C and C++, "x" is of type const char[] which is an exhibit and it is invalid ended (0x00). While 'x' is of type scorch . The datatype std::string .

What do you mean by logical error
the error made by the programmer while designing the logic of our program.these type of bugs are not detect by the compiler but output shows you wrong value. this type of errors  are located by carefully studied. 

How many keywords are there in C language
there are 32 keywords in C languag.Keywords are predefined, saved words in C language and every one of which is related with explicit elements. These words assist us with utilizing the usefulness of C language. They have extraordinary importance to the compilers. There are all out 32 keywords in C

if this content is useful for you please comment us

Post a Comment

0Comments
Post a Comment (0)