What is an interpreter and its need?

An interpreter is a program that translates source code written in high-level language to machine code. It is similar to compiler and does the same task of translation from high-level to low-level language. Despite of its similarity, the working mechanism of interpreter and compiler are different.

An interpreter does not translate whole code at once like compiler. Rather, is reads entire source code at once. Translates single instruction to machine code or some intermediate code. Then executes the translated machine code instruction immediately and translates next instruction if needed.

Read more

What is a compiler and its need?

A Compiler is a program or set of programs that converts source code written in a high-level language to low-level language (assembly language or machine language). A programming language can have many compilers. For example – GCC C, Turbo C, Quick C etc. are different compilers for C programming language.

Read more

Various programming paradigms

Programming paradigm is a way to classify programming languages according to their style of programming and features they provide. There are several features that determine a programming paradigm such as modularity, objects, interrupts or events, control flow etc. A programming language can be single paradigm or multi-paradigm.

With the wide spread of programming, various programming paradigms came into existence. Some popular programming paradigms are:

Imperative programming

Imperative programming is the oldest paradigm and is still in practice. It is the widely practiced paradigm in the day-to-day programming. It mainly focuses on steps to be done and works on the logic of “First do this then do that”. It defines a sequence of statements in order of which the operations must take place. In imperative programming, the control flow is explicit and depend on collection of GOTO statements. Imperative programming lacks the support of modularity.

Examples of imperative programming languages are – Assembly, C, C++, Java etc.

Read more

What is computer program and programming

Programming is an art, skill, poetry that is mastered through immense practice, patience, and experience. Before I formally define programming, let us talk about what is a computer program?

What is a computer program?

A Program is a set of instructions compiled together in a file to perform some specific task by the CPU (Central Processing Unit). It is a series of binary numbers (0s and 1s) arranged in a sequence, which when given to the computer performs some task.

Read more

How to create new C/C++ project in CodeBlocks

Hello friends, being a beginner to C/C++ everyone once had this question Where to write C/C++ codes? How to compile it? How to run it?. Codeblocks provides an ultimate solution to all these mentioned problems.

Code::Blocks is a IDE(Integrated Development Environment) for creating C/C++ projects. It is simple to use and provides very basic but powerful interface. CodeBlocks can be used for creating, editing, compiling, running and debugging C/C++ projects. Here is a beginner guide to use CodeBlocks.

Before preceding you must have Codeblocks with C/C++ compiler installed in your computer. If you don’t have Codeblocks installed download and install it before moving to the next step.

Read more

What is ASCII character code?

ASCII stands for American Standard Code for Information Interchange. It was developed by ANSI (American National Standards Institute). It is a set of decimal coded value for all basic printable and non-printable characters. For example – A is represented as 65 in ASCII standard. Similarly, there exists an integer value to represent every printable and … Read more

What are Escape sequence characters?

Escape characters are sequence of characters that are converted to some another character which are difficult or impossible to print directly. Characters such as new lines, you cannot print a new line directly in any programming language by hitting enter key. To print new line an special character is given \n which is later converted … Read more

How to find the size of data type using sizeof() operator in C

Sizeof(type) is a unary operator used to calculate the size(in bytes) of any datatype in C. Syntax: sizeof(type)Note: type must be replaced by a valid C data type or variable. Example: #include <stdio.h>int main(){ int i; printf(“Size of int = %dn”, sizeof(int)); printf(“Size of i = %dn”, sizeof(i)); return 0;} Output: Size of int = … Read more

List of all format specifiers in C programming

In C programming we need lots of format specifier to work with various data types. Format specifiers defines the type of data to be printed on standard output. Whether to print formatted output or to take formatted input we need format specifiers. Format specifiers are also called as format string.

Read more

Introduction to Programming – Errors

Errors are the mistakes or faults in the program that causes our program to behave unexpectedly and it is no doubt that the well versed and experienced programmers also makes mistakes. Programming error are generally known as Bugs and the process to remove bugs from program is called as Debug/Debugging. There are basically three types … Read more