Wednesday, July 21, 2021

We will discuss about  identifier and instructions in this chapter.

Identifier: 

Language is a medium of communication between two persons, as 
like that c language is a medium of communicate with machine and
persons. This is one way communication a programmer communicate
with machine programmer gave command to machine . If any person
learn any language then firstly he learn about alphabet then make word,
in c language every word is called identifier. In identifier we will discuss
about  constant ,variable and keywords.

Instructions:

Instructions are the combination of identifier .Instruction means giving 
command to the machine ,there will be different type of instructions like
data declaration instructions, input/output instructions ,arithmetic instruction
control instructions etc.

Collection of instructions is called Program.   

we will understand these term in  below given picture

 
so in this picture we can see that characters make identifier and
identifier makes instructions and lots of instructions make a 
Program.

In next chapter we will discuss about constants ,variable

and keywords.

  


Labels:

Sunday, July 18, 2021

Software development process

Software development process in c language.

what is software : 

Software is a collection of programs .Software is used to operate computer and doing specific task.
Software is a executable file which extension is .exe .
In this chapter we will discuss about how to make a software files in c programming language.

we will describe about the above figure about software development process.
If we make a simple programs  in c language, we make a  file  which extension is .c.
this is our source file in which we writes a programs.
 

pre-processor:

preprocessor is a program which perform before compilation process.
# is a preprocessor directives so , all statement which are included with # compiles 
with the help of preprocessors.

Header files:

All explanation of preprocessors are written in header files .
so with preprocessor and header files we make  new file which extension is .i
all  #(preprocessor ) will be translated before makes .i files.

 Compiler: 

compiler translate our code into machine language, compiler select all the code 
at a time and translate it into machine code.

.obj file:

After compiling all the code we found a .obj file in which our machine code is 
present in form of (0 and 1) and after with the help of linker and library file we
make our .exe file

linker provide linking between compiler and library files.

library files are files in which all details are present about predefined function.

.exe file:

This is executable file ,which are called software.





Labels:

Tuesday, June 2, 2020

Basic elements of part 3:


we discussed about statement in previous chapter ,so we will continue the various part of statement in this chapter.


various types of statement:


1)labeled statement :

labeled statement is used for set the location in a program  or it is used to transfer the control of the program . three types of labeled statement exist in c language. generally we are using (:) colon in the labeled statement.
1)Goto statement 
2)switch case statement
3)switch default statement

Goto statement: 

goto statement used  for the transfer the control in the program . it is rarely used because it less readable it makes programs complex and debugging is hard in this statement.  goto statement is divided into two parts .
1)forward jump
2)backward jump

1) syntax and example of forward jump:
                                  syntax:
                                              goto label name;
                                              statement
                                              ______________
                                              ______________
                                              ______________
                                              label name :
                                              statement
                      example:                                                                                                                                                  
    input:

 output  :                                                                                                                                     
        
                       
                                                                           


in this goto  statement we can see that, goto statement jumps two lines and print third lines. so we clearly understand that goto statement is used for jumping.

All others statement,are in the further chapters,so we know about the all statements in further chapter briefly.





 

Labels:

Saturday, May 16, 2020

Basic elements of c language part 2:


we discussed about basic element in c in previous chapter so, we will continue the chapter of basic element in c.

Variable declaration:

if we make any variable then we reserved a specific place in the memory  for the variable. variable declaration is so important because our compiler does not understand anything without declaration.
so we can say that variable declaration is a identity give  to compiler. what i am doing in program.
syntax of variable declaration,
datatype variable name;
for example
void main()
{
int a=5;     // variable declaration
printf("%d",a);
}
Here we can see we declare int type variable which name is a .so in our RAM memory a variable make 2 byte space for storing a particular data.

Statements in c language: 

statement are the command which are given in programs for doing a specific task,  like collect the inputs from the program.
for example:

#include<stdio.h>
 void main()
 {
  int x=6;
  int y=7;
       if(x<y)
        {
            printf("variable x is less than y");
         }
  getch();

  }

if condition(x<y) is true then the statement inside the body will be executed .

there are various types of  statement is given below:
1)labeled statement
2)compound statement
3)iteration statement
4)expression statement
5jump statement
6)selection statement

we will discussed about these statements in details in our next chapter .





                                     




Labels:

Friday, May 15, 2020


Element in c:

Every language has some basic element and there  own rule.c language has also some elements so before starting c language ,we know about the elements of c language.the basic elements of c language are character set, variable ,data type,keyword(reserve word), expression,variable declaration,statement etc.

character set used in c is given below:

1)Alphabets: 
As you know English grammar has 26 alphabets as same we use 26 alphabets in c language but c is case sensitive language ,so A----Z alphabets are different with a---z alphabets.

2)Digits:
digits are basically 0,1,2,3,4,5,6,7,8,9

3)special character:
special character are +, - , < , > , * , & , ^ , % , # , $ ,@, etc.

variable:

variable are the name of the memory location where we store the data.
for example  int a;
where a is the name of the memory location where we store data
if int a=5;
then, 




                                                                                                                                                                                              where we can see ,that a is the memory location name where store data,here our data is 5.
                                         

 Data type:

With the help of data type we declare the variable. data type determine the type and size of the data.
there are 5 keyword called data type in c language.
1)int (store 2 byte data in 16 bit architecture)
2)char(store 1 byte data in 16 bit architecture)
3)float(store 4 byte data in 16 bit architecture)
4)double(store 8 byte data in 16 bit architecture)
5)void

There are two type of data type in c language.

1)primitive data type
2)non primitive data type

primitive data type:

primitive data type is predefined data type.it is predefined in c library .
like int,char,float ,double.

Non primitive data type :

Non primitive data type is user define data type ,this data type defines by user itself
with  the help of structure,union etc. 

Keyword (reserved word):

keyword are predefined word this is also known as reserved word .
in these reserved word 5 word are data type.
there are 32 keyword in c language
These are the 32 keywords are given in the figure                                                                            we are discussing about variable declaration and statement in next chapter. 

Labels:

Thursday, May 14, 2020

History of c language: 

c language is developed in 1970's in bell laboratory  by Dennis Ritchie . ken Thomson is a another scientist who developed  B language in 1969 for developing the unix operating system. c language is developed by enhancing the B language.

why c language is so important: 

1)oracle in written in c language.
2)core libraries of android are written in c language.
3)almost every device drivers are written in c language.
4)unix operating system is developed in c language.
5)now a days c is not outdated language ,it is most popular language.
6) c language is most important for programming skill development.

characteristics of  c language:

1)c is middle level language.
2)because it is simple as high level language and powerful as low level language.
3)so we can write system program and application program both in c language.
4)c is general purpose language.
5)c is small language consisting only 32 words known as keyword.

  

Labels:

Wednesday, May 13, 2020

Before knowing c language,we know about the basic terminology of computer   

what is computer:

 computer is a electronic machine which can take some inputs and give output. It may be anything which takes input and give output is called computer.   

Difference  between electrical and electronic device

the electrical device produce current which means it has high voltage of current and its works on AC(alternative current) , but electronic device has not      voltage of current and its work on DC(dynamic current). Means electrical device can harm to man but electronic device not harm the people.                                                                                                                                      

  

 why we use c language:                          

we know that computer only understand binary number means (0 or 1) . Everything who has been store in computer memory is in form of (0 or 1). to understand (0 and 1) is very difficult.  So if we write anything in c language it is easy to understand rather than machine language (0 ०r 1) form.


   What is language:

language is a medium to conversation with two or more people each other. To share emotion, feeling etc . In same way to communicate with computer we use any programming  language like c, c++, java, python, swift, c# etc.




The programming languages can be classified into two types   


1)Low level language
2)High level language 

Low level language:


low level language can be categorised into two parts machine level language and assembly language 

Machine level language:

computer can understand only digital signal or binary digits(0 or 1). This is called machine level language. It is hard to understand  and write programs in machine level language.   


Assembly language:

                                                                                                                    assembly language reduced the difficulties of the machine level language. In assembly language instruction are given in English word like mov, add, sub so it is easier than machine level language. But low level language is related with hardware. In assembly language data store in register and each computer has different set of register so it is not portable.   But low level language intract with hardware so it's execution time is fast.




   High level language:


High level language is portable and machine independent means do not intract with hardware directly. These are English like language so it easy to understand and write program in high level language we used compiler or interpreter to translate these language into machine language 


   Translater:

 mainly translater translate high level language into machine level language . It can be classified into three categories  

1)Assembler 
2)compiler   
3)Interpreter 

Assembler:

 assembler is used to translate assembly language (low level language) to machine level language.


  Compiler:

compiler and interpreter  both are mainly used for translate high level language to machine level language but compiler read a whole program in a time then find error in program.


     Interpreter:


 interpreter also translate high level language to machine level language but it check program statement wise . After checking one statement it convert statement into machine code and execute this process continues till last statement. 



Labels: