Pages

Wednesday, 13 March 2013

#2 Basic Structure of a C++ Program

Let us create a simple 'Hello, World' program... Now just type what you see on the picture in your compiler, and later we will analyze it...
Source code :
After entering the code, you should compile and run your program using your compiler. In the case of Turbo C++ 4.5, for running, press ctrl+F9 or Debug --> Run
Output:
No let us look at the structure of the code..
#include<iostream.h> : This line is to link the program to be run, to a specific file called Header File, in which there are information about things to be done in the program. We will learn about this later...

void main() : This line is called a 'function'. It actually says the compiler that this is where the Program execution should begin. We will learn much more about Fuctions, in coming lessons.

{ & } : Opening and closing curly brackets are the starting, and stopping point of a function. 

cout : Input and output (I/O) operators are integral parts of any programming language. They are the interactive parts of a language. A language without I/O Operators are like a human body without any senses (blind, cannot smell, deaf, dumb, insensitive to the skin)... Whoo! Can't even imagine right? "cout" is one of the output operator of C++ ... That means, cout displays text in the output. Notice that after cout, there are two "<<" less than signs. (NOT ">>"). General form of cout is : | cout<<"text to be displayed"; | Also note that, the operator ends it's line with a semicolon ";". Now try displaying your name in the place of "Hello World" in your program. We will learn many I/O Operators in coming days.

COMMENTS : Comments are those lines in a program which the compiler ignores. In our hello world program, you can see many comment lines on the right side of each line, in dark blue color. Comments can be used for teaching, reminding yourself, and also it is an important part in readability. There are two types of comments :
1. Single line comments - They are those which start with two front slashes "//" These can only be used for commenting in a single line. Their general form is | //commentcontent | 
2. Multiple line comments - Those which start with a front slash and a star and ends with a star and a front slash, are multiple line comments. These can be used to type many lines and paragraphs. The compiler wont even look inside those "/*" and "*/" ! General form is : | /* comment content no limitsssss! */ |
But there are some limitations for WHERE to use multiple line comments. For example, it cannot be used in such a way: | for(i=0;i<n /* Comment invalid */ ; i++) | i.e inside a loop (later, I promise... ;) ) 


In next lesson, we will learn about input functions, where we can INPUT our own values to the program, operators in C++, and EXCLUSIVE : WE ARE GONNA MAKE A SIMPLE CALCULATOR!!! Excited huh??? See you next time... 


Happy Coding.. :)

Monday, 4 March 2013

#1 Introduction to C++ Programming - CPP Tutorials for Beginners

General Introduction




Waah! We are now going to study a brand new and wide subject, C++!
         
            C++ is both an object-oriented and general purpose programming language. There was this long conflict between programmers of 90's whether C or C++ is better. Well, everyone has different Point of Views.
                          I think it in this way : C++ has all features included in C, plus many other new features like Inheritance, Polymorphism (We will study these later). So, C++ is a super-set of C. Or, knowing C++ makes you familiar with almost all the features in C too. Obviously, there are differences in structures, but features are same.

      C++ was developed by a computer scientist named Bjarne Stroustrup, of Bell labs in 80's.

Enough trash talks. Let's get into business!

Beginning C++ 

Prerequisites

NOTHING! I mean it! Nothing!!! There is no need for prior experience in any other languages to learn C++
But a little logic will help.

Things You Need

You must have a not-so-bad computer, with any Operating system.
You must have a compiler of your choice (There are plenty out there in the internet). I am using Turbo C++ 4.5 for demonstration. (Google it, Download it!)

Next Step


Well, be equipped with the things above in the description and
Keep Calm and Wait for my Next Lesson! 

UPDATE : #2 is HERE!
;)

Happy coding! :)

Sunday, 3 March 2013

What is Data and What is Information?


Data and Information... These two are the two of the most used words by Computer Scientists and Geeks. What's the deal with them? Let's see:

Data

Data are plain/raw facts or figures. They are unorganized and meaningless fragments of input given or taken from  a source. An appropriate example is group of names of members in a particular group. When Data is put together in a meaningful fashion, it gives Information.

Information

Information is a group of data, which is arranged in such a way that it conveys a message to the reader.
Lets take the example of the group of names we discussed above. When we arrange this names in a particular order, for instance, when they arranged in alphabetical order, then we can call this Information!


Computer Science deals with the manipulation of data and information. 
Data  is manipulated to give out information, and information is manipulated to give out different results. This conversion/manipulation is called Data Processing. Cool right? Here is a flowchart showing the process of converting data into results. Here, we are taking the example of converting your marks in several subjects to your progress reports, or other results:



Another term related to this and often used by Computer Scientists is Knowledge. Use of information in appropriate situations, is called Knowledge.

That's it for today guys..

Happy Coding! :)

Saturday, 2 March 2013

Introduction to my blog...

Through this blog, I am planning to give away the most valuable, or should I say UNvaluable, thing... Information!
I am going to give tutorials on programming languages like C++ and Java, and web development languages like HTML, CSS, JavaScript, PHP etc; Be sure to subscribe to RSS feed, comment, and share the blog with your friends... :)

Happy Coding!