‘C’ PROGRAMMING TUTORIALS: INTRODUCTION
Here I am going to give ‘C’ tutorials and gonna teach you to write some programs which would further help you in your hacking stuff!
‘C’ as we all must have heard is a very versatile language and so is highly followed. The major languages in current time is directly and indirectly based on the concepts of ‘C’. Whether its c++, c#, Unix ‘c’,python, java and so on. Please don’t get afraid of the names as we’ll discuss their basic difference latter which you will feel to be quite negotiable.
Mean while am starting with ‘C’ because as I already said if you know ‘C’ then you can deal with all other major programming languages used globally.
Before ‘C’ many languages originated but they all couldn’t do what ‘C’ was capable of. Its ability to deal with system memory and format it as per our need.
One could find various books on ‘C’ in the market and even we are taught in class but the problem arises when they are unable to catch up the bookish language or the system followed by the teacher. And as there are many other students in the class the teacher can’t stop for us and has to continue. When i was asked to write on the given topic, I was quite nervous and a bit nervous even now to begin.
As I proceed further, I will try to demolish the same very gap between a learner and the books or teacher so that I could get the things very clear to you. I would also seek for your response and suggestions to make me understand about exactly what you want to know.
Getting started with ‘C’, we’ll first deal with the system in which we do a work.
Let’s take an example:
Suppose we have to prepare tea what will be the steps that we need to follow? We’ll start with
1. Boiling a cup of water.
2. After the water starts boiling, we add tea leaves in it ,
3.Wait till the color changes.
Similarly when we serve it:
4. Pour the filtered tea in cup,
5. Add milk and sugar to taste.
Here I have written the topics pointwise and in a serialised way because when we start our programming, you’ll se that all the jobs we perform in it is in a definite way or say system. There we need not to hurry for the technical points and just start thinking from where you’ll start the task and how you’ll proceed.
In the beginning you may write down them pointwise as i have already shown. We call it ‘Algorithm’ or ‘Pseudocode’ and there are no strict rules to write it.
Let’s see another example, suppose we have to swap the values of two given numbers say x=5 and y=9.
If we preserve the value of any one of the variables then we can change it with other and so on.
We’ll take another variable say, z.
Now z=x, that is value of x is now stored in z.
Then x=y , now the value of x will be 9.
Again we equate y=z, here the value in z that is 5 will now be the value of y.
It can be written in Algorithm as:
1. START
2. Read x=5, y=9 ,z.
3. z=x.
4. x=y.
5. y=z.
6. Print x & y.
7. END.
Here one thing we should take care of is that we write z=x, x=y and y=z that is the value on the right hand side is assigned to the variable on the left hand side and we aren’t allow to swap their places. We have taken a third variable to make it simple, for you try to swap the values without using the third variable. Believe me it’s not tough just open up your mind and start thinking. No one knows their potential. And from now on to think as a programmer try thinking about a particular task in a system/ sequence and I will tell you to give it the shape of a program in the coming days.
Till then am taking a break, ‘Think Healthy.’
‘C’ as we all must have heard is a very versatile language and so is highly followed. The major languages in current time is directly and indirectly based on the concepts of ‘C’. Whether its c++, c#, Unix ‘c’,python, java and so on. Please don’t get afraid of the names as we’ll discuss their basic difference latter which you will feel to be quite negotiable.
Mean while am starting with ‘C’ because as I already said if you know ‘C’ then you can deal with all other major programming languages used globally.
Before ‘C’ many languages originated but they all couldn’t do what ‘C’ was capable of. Its ability to deal with system memory and format it as per our need.
One could find various books on ‘C’ in the market and even we are taught in class but the problem arises when they are unable to catch up the bookish language or the system followed by the teacher. And as there are many other students in the class the teacher can’t stop for us and has to continue. When i was asked to write on the given topic, I was quite nervous and a bit nervous even now to begin.
As I proceed further, I will try to demolish the same very gap between a learner and the books or teacher so that I could get the things very clear to you. I would also seek for your response and suggestions to make me understand about exactly what you want to know.
Getting started with ‘C’, we’ll first deal with the system in which we do a work.
Let’s take an example:
Suppose we have to prepare tea what will be the steps that we need to follow? We’ll start with
1. Boiling a cup of water.
2. After the water starts boiling, we add tea leaves in it ,
3.Wait till the color changes.
Similarly when we serve it:
4. Pour the filtered tea in cup,
5. Add milk and sugar to taste.
Here I have written the topics pointwise and in a serialised way because when we start our programming, you’ll se that all the jobs we perform in it is in a definite way or say system. There we need not to hurry for the technical points and just start thinking from where you’ll start the task and how you’ll proceed.
In the beginning you may write down them pointwise as i have already shown. We call it ‘Algorithm’ or ‘Pseudocode’ and there are no strict rules to write it.
Let’s see another example, suppose we have to swap the values of two given numbers say x=5 and y=9.
If we preserve the value of any one of the variables then we can change it with other and so on.
We’ll take another variable say, z.
Now z=x, that is value of x is now stored in z.
Then x=y , now the value of x will be 9.
Again we equate y=z, here the value in z that is 5 will now be the value of y.
It can be written in Algorithm as:
1. START
2. Read x=5, y=9 ,z.
3. z=x.
4. x=y.
5. y=z.
6. Print x & y.
7. END.
Here one thing we should take care of is that we write z=x, x=y and y=z that is the value on the right hand side is assigned to the variable on the left hand side and we aren’t allow to swap their places. We have taken a third variable to make it simple, for you try to swap the values without using the third variable. Believe me it’s not tough just open up your mind and start thinking. No one knows their potential. And from now on to think as a programmer try thinking about a particular task in a system/ sequence and I will tell you to give it the shape of a program in the coming days.
Till then am taking a break, ‘Think Healthy.’
No comments:
Post a Comment