Skip to main content

Compiler And Interpreter ( difference between Compiler and Interpreter )

 Compiler And Interpreter :-

Basically compiler and interpreter , both are a types of translator which is used to translate your program written in high level language ( human understandable form ) into low level language ( machine understandable form ) . 

Compiler :- 

Compiler is a type of a computer program which is used translate  high level language into low level language i.e machine language . Compiler takes high level language as input and produces output which is in machine understandable form ( binary 0 and 1 ) .

Some points which we should remember :

  • Compiler is just a program , it is not come in used to fix error found in program .
  • if you have a program written in wrong syntax , it will not compile .

See in the above figure's left side , there is program written in whatever language ( c , c++ , java etc ) which are high level . Now this program has go through with compiler and it has been converted into binary form ( 010101 like this ) . I hope now you have understand clearly all about compiler .

 lets discuss characterstics of compiler 
  1. It generates a intermediate object code .
  2. Compiler used to scan whole program in one at a time . 
  3. before execution of any program , program would be compile first .
  4. Program execution is faster in use but it is difficult as compared to interpreter ( we will see about it below) .
  5.  C , C++, C#  are the programming language  Which uses compiler .
Interpreter :-
Interpreter is a translator ( program ) which is also used to convert the code written in high level language into machine language . But the main points which differs it from compiler is, it translate only single statement of program at a time . It takes first line of our program , translate it and then it takes second line and translate , then third line , forth line and so on ......


Important points which should remember about interpreter :
  1. It is used to translate one line of program one at a time .
  2. It takes very less time to analyse the code but overall time is much higher than compiler .
  3. It does not generate any intermediate code like object code .
  4.  The programming which used interpreter are Python , Ruby .
  5. No generation of any intermediate phase , so it is considered as highly efficient in terms of its memory .
Note :- The main advantage of using compiler is its execution time which is much less than that of interpreter . 
And the main advantage of using interpreter is its translation of line of program . This is because it keeps translating all line one by one , but there are any error spotted , it stops working . hence debugging become easy . 


Request :- You please must follow must follow my instagram page which is related to this feild , I am posting their regularly  . 














Comments

Popular posts from this blog

Complete Strategy to clear TCS Xplore IPA in One Attempt Now ( 80+ Score )

  So hello Everyone , Here are the all Links from where you can Practice !  All the resources are searched from my best !  1. For KYT and Bizzskill  Link :- tcs Xplore course  2. Unix Operating system Link :-    a.  click here Link 1 b.  click here Link 2 c.  Click here Link 3   3. UI  Link :-  click here 4. SQL and Pl SQL Link : -  Click here Click here click here 5. Java MCQ  Link :-  click here click here click here 6. Java coding :-  Access the playlist on YouTube :-  click here to watch Access the blogs :-  click here All in one link :-   click here

TCS IPA previous year quistion ( 35 marks ) , Quistion , Input , output

 Problem Statement Video Link :    https://youtu.be/XCBvfJAo908 Create a class TravelAgencies with below attributes: regNo – int agencyName – String pakageType – String price – int flightFacility – boolean Write getters, setters for the above attributes . Create constructor which takes parameter in the above sequence. Create class Solution with main method. Implement two static methods – findAgencyWithHighestPackagePrice and agencyDetailsforGivenIdAndType in Solution class. findAgencyWithHighestPackagePrice method: This method will take array of TravelAgencies objects as an input parameter and return the highest package price from the given array of objects. agencyDetailsForGivenldAndType method: This method will take three input parameters -array of TravelAgencies objects, int parameter regNo and String parameter packageType. The method will return the TravelAgencies object based on below conditions. FlightFacility should be available. The input parameters(regNo and packageType) shoul

TCS IPA previous year problems solved [input + output ] in JAVA - (35 marks )

  Problem Statement :  Video Link :   Click Here Create a class AutonomousCar with the below attributes: carld – int brand – String   noOfTestsConducted – int noOfTestsPassed- int environment – String grade – String Write getters, setters for the above attributes . Create constructor which takes parameter in the above sequence except grade. Create class Solution with main method. Implement two static methods – findTestPassedByEnv and updateCarGrade in Solution class. findTestPassedByEnv method: This method will take two input parameters -array of AutonomousCar objects and string parameter environment. The method will return the sum of the noOfTestsPassed attribute from autonomousCar objects for the environment passed as parameter. If no autonomousCar with the given environment is present in the array of AutonomousCar objects, then the method should return 0. updateCarGrade method: This method will take a String parameter brand, along with the array of AutonomousCar objects. The method