Wednesday, 27 July 2016

A Simple C Program

Lets write a basic C program.

In order to write up your first C program, You have to download IDEs to compile and run your programs. There are various C programs available on the internet. I'm currently using Turbo c++.
Here's a link
So, lets get started.


Compiling and Running C Programs

Compiling C program requires working with four kinds of files ---


  • Regular Source Code Files - These files contain function definitions and have an extension '.C '.
  • Header Files - These files contain declarations (also known as function prototypes) and various pre-processor statements. They are used to allow source code files to access externally defined functions. Header files have '.h ' extension.
  • Object Files - These files are produced as the output of the compiler. They consist of various function definitions in binary form, but they are not executable by themselves.object files have '.obj ' extension.
  • Binary Executable - These are produced as the output of a program called  'Linker'. The linker links together a number of object files to produce a binary file that can be directly executed. They have no suffix in UNIX but have '.exe ' on Windows.

Monday, 25 July 2016

Learning Red hat - A Linux OS

An operating system is a program that manages the computer hardware. It also provides a basis for application programs and acts as an intermediate between the user and the computer hardware.


A computer system can be divided roughly into four components:
  • The Hardware
  • The Operating System
  • The Application Programs
  • The Users
The Hardware - provides the basic computing resources with the help of the Central Processing Unit (CPU), the memory, the input/output devices.
The Application Programs -  They define the ways in which these resources are used to solve user's computing problems. For instance, word processors, spreadsheets, compilers, web browsers, etc.
The Operating system is similar to a government. Like a government, it performs no useful function by itself. It simply provides an environment within which user or other programs can do useful work.


Most of us are acquainted with the Windows operating system, provided by Microsoft. Aside this, there are other operating systems like Linux, Unix, Solaris, etc.
Each OS(operating system) is different from another as they use different scheduling algorithms, solve their critical section problems differently, that is, they perform the tasks in different ways.




So, lets start understanding Linux operating system. In the next posts on this topic we will be using Red Hat OS (v 7.1).


In 1969 three software engineers,
  • Dennis Ritchie
  • Richard Stallman
  • Ken Thompson
developed an operating system named 'UNIX'.




UNIX was based on C programming language. It was not open source but hardware dependent like HP to HP, or IBM to IBM, etc. It was set up in Bell Labs at AT&T (American Telecom and Telegraph) Company.




In  1991, Linus Torvalds, a student of Helsinki University developed "MINIX" kernel and developed a new OS known as LINUX.




LINUX is an open source OS. It is not hardware dependent.

Sunday, 24 July 2016

Need to Learn C

There are a large number of programming languages in the world today - C++, C#, Java, Ada, BASIC, Perl, etc. Even so, there are several reasons to learn C. Some of them are -


  • C is a common language.
  • C is a small language. C has only 32 keywords. This makes it relatively easy to learn compared with bulkier languages.
  • C is a stable language. The ANSI for C was created in 1983. The language has not been revised since then.  However, this doesn't mean that all C code is standard. In newer languages, the standard changes regularly and often.
  • C is a quick language. A well written C program is likely to be quick as or quicker than a well written program in any other high level language.
  • C is a core language. A number of popular languages are based on C. Having learnt C, it will be much easier to learn languages that are largely partly based upon C. Such languages include C++, Java, Perl.


It is often said that C is the second best language for any given programming task. The best language depends on the nature of the particular task but the second best language is C, whatever the task.

Saturday, 23 July 2016

History of C

The story started with the Common Programming Language (CPL) which was turned into Basic Combined Programming Language (BCPL) by Martin Richards. This was essentially a type-less language, which allowed the user the direct access into the computer's memory. This made the language useful to programmers.


Ken Thompson at Bell Labs, USA  wrote his own variant of BCPL and called it B. In due course, the designers of UNIX modified it to produce a programming language called C.
Dennis Ritchie, also at Bell Labs, is credited for designing C in the early 1970s. Subsequently, UNIX was rewritten entirely in C. In 1983, an ANSI standard for C emerged making it acceptable internationally.


Ninety percent of the code of the UNIX operating system is written in C. The name C is doubly appropriate being the successor of B and BCPL.


C is a mid-level programming language, not as low level as assembly and not as high level as BASIC.

Friday, 22 July 2016

Lets Start With "C"

Hey guys.
In the previous posts we learnt about the way in which the computers works. Lets take another step in learning a language. Every interface that we use now has gone through a lot of upgrades and enhancements. Even the web browsers that we use now has gone through a lot of testing and previous versions and a lot of codes have been implemented on it. But we can't understand those codes right now just like we cannot run before learning to walk first.


So, lets start with an elementary programming language "C" (spelt see).


C programming language is one of the old programming languages and is not much used in the present day. But it helped in designing many operating system in their early days. It is one of the basic languages that every programmer knows.


So, Lets start this journey with our first programming language - "C".




Book Followed-
Computer Fundamentals and Programming in C - Pradip Dey, Manas Ghosh, Oxford Publication.

Thursday, 21 July 2016

Languages Computer Speak

Okay, its time to learn a way to interact with the computer. Just like any other forms of communication interacting with computer involves languages.
There are basically 3 types of languages when it comes  interacting with a computer.
1. Higher level language
2. Lower level language
3. Assembly language

  • High level languages are the language that can be easily understood by a human being. For an instance, English is a high level language.
  • Lower level language is understood by the computers. Hence it is also known as 'Machine Language'. It consists of zeroes and ones that interact directly with the hardware components of the computer.
  • An assembly language is the first step to improve programming structure and make machine language more readable by humans. An assembly language consists of a set of symbols and letters. It can be called the second generation language since it no longer uses 1s and 0s to write instructions, but terms like MOVE, ADD, SUB and END.

High level languages can be written and executed in all computers but this isn't the case with machine language. Machine language varies from one computer to another.

Earlier Assembly Languages were used to write programs, but recently high level languages are used. Programmers still use the assembly language when speed is essential or when they need to perform an operation that isn't possible in a high-level language.

The high level languages cannot be understood by the computer, as it only understands lower level language which are written in zeroes and ones. Let say there are two people who cannot understand each other, that is they speak different languages. So, in that case a third person is required who understands both their languages and interprets to them. Likewise, there are certain programming bodies who convert the language between the machine and the user. There are three types of convertors,
1. Compiler
2. Interpreter
3. Assembler

Compiler and Interpreter convert high level languages to machine languages.

  • Compiler scans the entire program once and then converts it into machine language which can then be executed by computer's processor. In short compiler translates the entire program in one go and then executes it. Interpreter on the other hand first converts high level language into an intermediate code and then executes it line by line.
  • The execution of program is faster in compiler than interpreter as in interpreter code is executed line by line.
  • Compiler generates error report after translation of entire code whereas in case of interpreter once an error is encountered it is notified and no further code is scanned. Example Python is an interpreted language whereas C,C++ are compiled languages. Java however uses both compiler and interpreter.

Assembler is used for converting the code of assembly language into machine level language.

Wednesday, 6 July 2016

Lets Begin

Hello Again,
 
We have all used a computer. And we all know how to create files, open them, copy files, and all other things. Basically we all know how to operate a computer. We can do anything on a computer. So, how does the computer understand what we are trying to do? It doesn't have a mind. So, how does it does all those things?

Basically, computer is nothing but a set of capacitors and conductors.  It just operates differently when the input current is altered. Hence comes the 0s and 1s. When current is passed into a  hardware part it is taken as 1 and when there is no current it is taken as 0.
So, based on current on , current off the device performs differently. So, it can be said that computer only understands the language of 0s and 1s.

Now that raises another question. How does computer understand all that we say just by 0s and 1s?
Actually the number of zeros and ones are not limited.
For example, "1000100010111" is different from"100010" which is also different from "100011".
As there is no limit the number of times 0s and 1s are used, computer can understand a lot of things.

But how do we know how many 0s and how many 1s to be written?
There always a possibility of concurrency and duplication . Lets say, i want my computer to take 101 as A , 1011 as B and so on. But my friend's computer takes 1001 as A, 11001 as B and so on. So, here comes a problem. As computer was to be used world wide it was not possible for everyone to have their own key assignments, it had be same everywhere. A lot of companies tried to assign standard values. And at last ASCII (American Standard Code for Information Interchange) came into existence.

Introduction

Hello, Everyone.

Welcome to the world of computers. Today everything we see is directly or indirectly made by computers. Knowing computers and interacting with it has become a necessity.
Everyday a lot of people start a new day in the binary world.
For all those people who want to learn more about computers, and want to learn ways to interact with it, this site will serve you to the fullest.

This site is setup by a couple of students whose lives have been transformed by the world of technology. We wanted to learn more about this world, the digital world. But we had to face a lot of challenges. Gathering information, finding appropriate software, understanding concepts are few among the among the difficulties that we faced. So, we developed this site for all those people who are just beginning their journey in the world of computers.

This site will feature learning computer languages,finding useful software, programming codes. Apart from those, it will also serve as a knowledge center for students who can gather useful information.Feel free to comment for doubts and improvements and we will respond ASAP.

Thank You.