Last Updated : 29 Mar, 2023
Introduction:A programming language is a set of instructions and syntax used to create software programs. Some of the key features of programming languages include:
Examples of popular programming languages include Python, Java, C++, JavaScript, and Ruby. Each language has its own strengths and weaknesses and is suited for different types of projects.
A programming language is a formal language that specifies a set of instructions for a computer to perform specific tasks. It's used to write software programs and applications, and to control and manipulate computer systems. There are many different programming languages, each with its own syntax, structure, and set of commands. Some of the most commonly used programming languages include Java, Python, C++, JavaScript, and C#. The choice of programming language depends on the specific requirements of a project, including the platform being used, the intended audience, and the desired outcome. Programming languages continue to evolve and change over time, with new languages being developed and older ones being updated to meet changing needs.
Are you aiming to become a software engineer one day? Do you also want to develop a mobile application that people all over the world would love to use? Are you passionate enough to take the big step to enter the world of programming? Then you are in the right place because through this article you will get a brief introduction to programming. Now before we understand what programming is, you must know what is a computer. A computer is a device that can accept human instruction, processes it, and responds to it or a computer is a computational device that is used to process the data under the control of a computer program. Program is a sequence of instruction along with data.
The basic components of a computer are:
The CPU is further divided into three parts-
Most of us have heard that CPU is called the brain of our computer because it accepts data, provides temporary memory space to it until it is stored(saved) on the hard disk, performs logical operations on it and hence processes(here also means converts) data into information. We all know that a computer consists of hardware and software. Software is a set of programs that performs multiple tasks together. An operating system is also software (system software) that helps humans to interact with the computer system.
A program is a set of instructions given to a computer to perform a specific operation. or computer is a computational device that is used to process the data under the control of a computer program. While executing the program, raw data is processed into the desired output format. These computer programs are written in a programming language which are high-level languages. High level languages are nearly human languages that are more complex than the computer understandable language which are called machine language, or low level language. So after knowing the basics, we are ready to create a very simple and basic program. Like we have different languages to communicate with each other, likewise, we have different languages like C, C++, C#, Java, python, etc to communicate with the computers. The computer only understands binary language (the language of 0’s and 1’s) also called machine-understandable language or low-level language but the programs we are going to write are in a high-level language which is almost similar to human language.
The piece of code given below performs a basic task of printing “hello world! I am learning programming” on the console screen. We must know that keyboard, scanner, mouse, microphone, etc are various examples of input devices, and monitor(console screen), printer, speaker, etc are examples of output devices.
main() { clrscr(); printf(“hello world! I am learning to program"); getch(); }
At this stage, you might not be able to understand in-depth how this code prints something on the screen. The main() is a standard function that you will always include in any program that you are going to create from now onwards. Note that the execution of the program starts from the main() function. The clrscr() function is used to see only the current output on the screen while the printf() function helps us to print the desired output on the screen. Also, getch() is a function that accepts any character input from the keyboard. In simple words, we need to press any key to continue(some people may say that getch() helps in holding the screen to see the output).
Between high-level language and machine language, there are assembly languages also called symbolic machine code. Assembly languages are particularly computer architecture specific. Utility program (Assembler) is used to convert assembly code into executable machine code. High Level Programming Language is portable but requires Interpretation or compiling to convert it into a machine language that is computer understood.
Hierarchy of Computer language -
There have been many programming languages some of them are listed below:
C Python C++ C# R Ruby COBOL ADA Java Fortran BASIC Altair BASIC True BASIC Visual BASICMost Popular Programming Languages -
Characteristics of a programming Language -
Here the basic code for addition of two numbers are given in some popular languages (like C, C++,Java, Python, C#, JavaScript etc.).
C++
// C++ program for sum of 2 numbers
#include <iostream>
using namespace std;
int main()
{
int a, b, sum;
a = 10;
b = 15;
sum = a + b;
cout << "Sum of " << a << " and " << b
<< " is: " << sum; // perform addition operation
return 0;
}
// This code is contributed by Susobhan Akhuli
C
// C program for sum of 2 numbers
#include <stdio.h>
int main()
{
int a, b, sum;
a = 10;
b = 15;
sum = a + b;
printf("Sum of %d and %d is: %d", a, b,
sum); // perform addition operation
return 0;
}
// This code is contributed by Susobhan Akhuli
Python3
# Python program for sum of 2 numbers
a = 10
b = 15
add = a + b # perform addition operation
print(f"Sum of {a} and {b} is: {add} ")
# This code is contributed by Susobhan Akhuli
Java
// Java program for sum of 2 numbers
import java.io.*;
class GFG {
public static void main(String[] args)
{
int a, b, sum;
a = 10;
b = 15;
sum = a + b;
System.out.println(
"Sum of " + a + " and " + b
+ " is: " + sum); // perform addition operation
}
}
// This code is contributed by Susobhan Akhuli
C#
// C# program for sum of 2 numbers
using System;
class GFG {
public static void Main()
{
int a, b, sum;
a = 10;
b = 15;
sum = a + b;
Console.Write("Sum of " + a + " and " + b + " is: "
+ sum); // perform addition operation
}
}
// This code is contributed by Susobhan Akhuli
JavaScript
<script>
// Javascript program for sum of 2 numbers
let a = 10;
let b = 15;
let sum = a+b; //perform addition operation
document.write("Sum of " + a + " and " + b
+ " is: " + sum);
// This code is contributed by Susobhan Akhuli
</script>
PHP
<?php
// PHP program for sum of 2 numbers
$a = 10;
$b = 15;
$sum = $a+$b; //perform addition operation
echo "Sum of $a and $b is: $sum";
//This code is contributed by Susobhan Akhuli
?>
Scala
// Scala program for sum of 2 numbers
object Main {
def main(args: Array[String]) {
val a = 10;
val b = 15;
val sum = a + b; //perform addition operation
println("Sum of " + a + " and " + b
+ " is: " + sum);
}
}
//This code is contributed by Susobhan Akhuli
HTML
<html>
<head>
<script>
// HTML program for sum of 2 numbers
a = 10;
b = 15;
sum = a + b; //perform addition operation
document.write(Sum of " + a + " and " + b + " is: " + sum);
//This code is contributed by Susobhan Akhuli
</script>
</head>
</html>
Cobol
*> Cobol program for sum of 2 numbers
IDENTIFICATION DIVISION.
PROGRAM-ID. SUMOFTWONUMBERS.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 B PIC 99.
77 A PIC 99.
77 SU PIC 99.
PROCEDURE DIVISION.
SET A TO 10.
SET B TO 15.
ADD A B GIVING SU.
DISPLAY "Sum of " A " and " B " is: "SU.
STOP RUN.
*> This code is contributed by Susobhan Akhuli
Dart
// Dart program for sum of 2 numbers
void main() {
var a = 10;
var b = 15;
var sum = a+b; // perform addition operation
print("Sum of ${a} and ${b} is: ${sum}");
}
// This code is contributed by Susobhan Akhuli
Go
// Go program for sum of 2 numbers
package main
import "fmt"
// Main function
func main() {
a:= 10
b:= 15
su:= a + b // perform addition operation
fmt.Printf("Sum of %d and %d is: %d", a, b, su)
}
// This code is contributed by Susobhan Akhuli
Julia
# Julia program for sum of 2 numbers
a = 10
b = 15
su = a + b # perform addition operation
println("Sum of ", a, " and ", b, " is: ", su)
# This code is contributed by Susobhan Akhuli
Kotlin
// Kotlin program for sum of 2 numbers
fun main(args: Array<String>) {
val a = 100
val b = 200
val sum = a + b // perform addition operation
println("Sum of $a and $b is: $sum")
}
// This code is contributed by Susobhan Akhuli
Perl
# Perl program for sum of 2 numbers
$a = 10;
$b = 15;
$sum = $a + $b; # perform addition operation
print("Sum of $a and $b is: $sum");
# This code is contributed by Susobhan Akhuli
Swift
// Swift program for sum of 2 numbers
import Swift
var a = 10;
var b = 15;
var su = a+b; // perform addition operation
print("Sum of", a, "and", b, "is:", su);
// This code is contributed by Susobhan Akhuli
Sum of 10 and 15 is: 25
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4