Computer Applications
Programming Languages
Source Code
Compiler
Machine Code
Program Execution
Input Data
Output Data
Location (lat,long)
Weather Forecast
(40,70,30)
Sum = 140
Its the Programmer, who writes all this code
A computer program is a set of instructions, written in a programming language.
We need language to communicate our ideas!
English, Hindi,
German, French
etc.
We need Language to communicate our ideas!
C++, Java, Python, JavaScript etc
We need Language to communicate with a computer too!
Programming languages are set of rules that consist of instructions for computers. There are many programming languages like C++, Java, Python, JavaScript, Go, Kotlin, DART etc.
Sample C++ Code
#include<iostream>
using namespace std;
int main(){
// Your Code Goes Here
cout <<"Hello World!";
return 0;
}
Sample Java Code
class Main {
public static void main(String args[]) {
// Your code goes here
}
}
class Main {
public static void main(String args[]) {
// Your code goes here
System.out.println("Hello");
}
}
Source Code
Computers don't understand Programming Language directly!
#include<iostream>
using namespace std;
int main(){
// Your Code Goes Here
cout <<"Hello World!";
return 0;
}
Source Code
A computer program in its human-readable form is called source code.
Source code needs another computer program to execute because computers can only execute their native machine instructions. Therefore, source code may be translated to machine instructions using the language's compiler.
#include<iostream>
using namespace std;
int main(){
// Your Code Goes Here
cout <<"Hello World!";
return 0;
}
Source Code
Compiler
Machine Code
Machine language is a set of instructions executed directly by a computer’s central processing unit (CPU). Each instruction performs a very specific task, such as a load, a jump, or an ALU operation on a unit of data in a CPU register or memory. Every program directly executed by a CPU is made up of a series of such instructions.
#include<iostream>
using namespace std;
int main(){
// Your Code Goes Here
cout <<"Hello World!";
return 0;
}
Source Code
Compiler
Machine Code
Once the instructions are fed, the computer program is ready to accept input data and generate desired output.
Output
Input
Logic
Program Execution
When a program starts executing, then the operating system loads it into memory and starts a process. The CPU starts executing the instructions written in the program and any required data is also loaded into memory (RAM).
CPU + Memory
Program Execution
When a program starts executing, then the operating system loads it into memory and starts a process. The CPU starts executing the instructions written in the program and any required data is also loaded into memory (RAM).