Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

C for Beginner -- part1 : Computer Programming Basics

c beginner fresher

  • Please log in to reply
2 replies to this topic

#1 kernelcoder

kernelcoder

    CC Devotee

  • Expert Member
  • PipPipPipPipPipPip
  • 990 posts
  • Location:Dhaka
  • Programming Language:C, Java, C++, C#, Visual Basic .NET
  • Learning:Objective-C, PHP, Python, Delphi/Object Pascal

Posted 19 February 2013 - 11:57 PM

Hello everyone!

This series of tutorials are for those who  are beginner and want to learn C programming. If someone knows about computer programming that's good but if not, this tutorial will guide you to learn about computer programming and then we will start learning C programming.

 

 

Computer Programming

Computer doesn't know  English or other languages but there are many languages computer can understand : known as programming language. Example: C, C++, Java, PHP etc. Well, Computer (actually the processor) don't even understand them but only machine/binary code/language. But its tedious tasks for human to write program in binary/machine code. So there are some intermediate or high level languages (C, C++, Java and others) which are for human to write code. There are some programs which translates code from those intermediate languages to machine/binary code. We call this programs compiler or interpreter. By the programming languages we generally give instructions to computer  to perform some specific tasks, these instructions are combinedly called as 'Program' or 'Computer Program' and the instructions are called as 'Code'. So computer programming is to write instructions for computer in any programming language. These instructions can be written by following the structure of that programming language.

 

So the basic need to write a computer program is to decide what is the task. Then writing the code. When we run the program only then computer can get those instructions and will perform the task if everything goes fine. So a new thing comes up "running the program". Running the program is the process to execute the compiled Code. Compilation is the process to find out whether the instructions are syntactically okay and follow the standard and structure of the language. We will cover these terms in our next part of this tutorial.

 

 

A Simple Computer Program

Let us think a problem: We want our computer can add two numbers. Generally there are programs come with operating system named as calculator that can do this simple task but we want to make a computer program that can add two numbers. Firstly, our program needs these two numbers we want to add. When these numbers are supplied to our program the instruction of addition will add the numbers and finally shows us the sum. The algorithm for this task is

algorithm.png

Algorithm is the step by step solution of a problem(Here addition of two numbers). The picture shows  the flow chart(graphical representation of an algorithm) of addition of two numbers.

Let the numbers be 15 and 7. So the addition of these two numbers will be 15+7=22. Our task is to write the instruction of addition of two numbers. The addition instruction in C language

sum = number1 + number2;

See the instruction is ended with a semicolon, we call this complete instruction as statement. So this simple statement can produce the summation of number1(=15) and number2(=7) as sum(=22). When the sum is produced we will simply write a statement that will show the sum in the computer window. So we have the idea of a computer program. 

Computer programs have zero or more inputs and zero or more outputs. The inputs can be various type, for the addition program input was two numbers and output was the sum. 

 

In our next tutorial  will learn about "C Programming Language" with an example of Hello World program.

Attached Files


  • 2

#2 quynhpham281291

quynhpham281291

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts
  • Learning:C, C++, C#, Assembly

Posted 13 March 2013 - 08:33 AM

Thanks so much! This tutorial is very helpful to learn C quickly and effectively.


  • 0

#3 charlesdavis

charlesdavis

    CC Regular

  • Member
  • PipPipPip
  • 34 posts
  • Location:Noida
  • Programming Language:C, C++, C#, PHP, PL/SQL, Visual Basic .NET
  • Learning:Assembly, Fortran, Prolog

Posted 12 May 2015 - 10:11 PM

Your write very basic thing here and try to put something about their data types and their range

too?


  • 0





Also tagged with one or more of these keywords: c, beginner, fresher