Friday, 21 February 2014

SEE, 'C' is SEA



Hai friends:
            C, Sea, See -1 welcomes you all. In this series of episode, I’m going to post the basics of C language. As against the post title C is not so big. It’s actually confined even lacking the most basic input and output operation. But on the other hand, C is really sea that it can be widened to include library and user defined functions. Even though CPP and Java are sitting in the driving seat, C still holds the grip and reserves its own space. Why? Why C is so important?
1.     Nobody can learn CPP or Java directly. They have to thorough with C before migrating to those languages.
2.     Major parts of popular Operating Systems are still written in C.
3.     Many mobile devices where speed has to be achieved with limited amount of memory use C.
4.     Arcade games are known for their speeds. This is where C scores more than other languages.
5.     C provides feasible ways to interact with the hardware devices.

Before getting wet into C deeper, we have to be clear with C elements and some zeroth level works. So what are we waiting for? Let’s dive in…
C character set:
C Character Set is exactly the same as alphabets in English. Like the English language is developed using alphabets, C is built using the Character set. The Character set includes constants, variables and keywords.


A,B,C,……Z
a,b,c,……z
0,1,2,3,…9
. , ‘ “ ; : > < ? } { ( ) - + = _ ! & * / | etc.,
C character Set


Constants:
            Constants are those whose values can’t be changed. There are two types of constants in C. They are primary and secondary constants. Primary constants include integer, float and character while secondary includes array, pointer, structure, union... Now consider this. Computer memory is made of smaller cells as seen below. Each cell has its own address. Now for a value to be stored in the memory it must be stored in any of these cells.















3



































Here a value 3 is stored in one of the cells. The value of 3 is going to be 3 all the time, so it is what a constant is. If we want to use this value in our program, we have to call this memory location which could be tedious. Can’t it be nice to use names to call these values? Yes, we can! These names are called variables. The value of the variables can change which is self-explanatory. Now let’s choose a variable, say x. Now the statement x=3 leads to the value 3 stored in the variable x. It is to be noted that each variable can contain only one data at a time. So if we hen declare x=5, it will replace the previous value 3 and now x will contain 5.
We have seen that there are 3 types of constants under the primary type. Let’s discuss each in brief. Secondary types are reserved for future posts.
Integer Constants:
1.     Integer constants are nothing but the whole numbers but include both +ve and –ve numbers.
2.     No commas or blank spaces to be inserted while declaring it.
3.     It must not have any decimal point.
4.     The range of integers depends on compilers. For a 16-bit compiler the range is -32768 to 32767. (range sense the upper and lower boundary values that an integer can take).
e.g: -320, 6000, 32765 are all possible but not 32768 and more.

Floating point Constants:
1. Integer constants are nothing but the whole numbers but include both +ve and –ve numbers.
2. No commas or blank spaces to be inserted while declaring it.
3.     It must contain decimal point.
4.     It can be expressed as exponential form also. While expressing as exponential, e should be included to separate mantissa and exponential part.
5.     The range of floating point is -3.4e38 to 3.4e38.

E.g: 56.87, 3.14, 50e-3, 3e8.
Character Constants:
1.     A character should be enclosed by a single quote.
2.     Each variable can contain only one character at a time.
E.g: ‘A’, ‘a’.

Variables: If there are three types of primary constants, the variables holding them must also be three types. Yes, indeed. Each variable can contain data of same type only and does not permit heterogeneous data. For instance, if a variable x contains integer data type then it can’t hold data types other than integer.
Unlike Constants, there exists same set of rules for declaring all types of variables. They are as follows:
1.     The maximum allowable range for variable name is 31 (some compilers can have extended range).
2.     Each variable must starts with alphabetic or underscore.
3.     Numbers can be included in the middle or at the end of the variable.
4.     No special character should be used other than underscore in a variable.
Now a question arises? If all the data types are declared using same set of rules how the compiler distinguishes between them. The answer is flat. We have to declare which data type it belongs to using keyword.
E.g: int a;
float b;
char c;
here int, float and char refers to keywords.
Keywords:
 Keywords are reserved words in C language that have special functions. In other words, the meanings of keywords are already told to the compiler. There are 32 keywords in C. These keywords can’t be used as variables. The list of keywords is as follows. I prefer to define them when their use comes rather now.


auto               double           int                   struct
break             else                 long                switch
case                enum             register         typedef
char                extern            return            union
const              float               short              unsigned
continue       for                  signed            void
default           goto               sizeof             volatile
do                   if                      static              while

and now we are one step away from writing C program. Let’s define few points that are to be considered while writing C program.
1.     C program is a free form program that it has no specific rules on the starting point of the statement.
2.     C program is sequential that it should be written in the order of its execution.
3.     Every statement must be terminated by a semicolon (;).
4.     Blank spaces may be introduced between the words to increase the readability of the program.
That’s all for now. Let’s start our first C program in the very next post.

Tuesday, 4 February 2014

Poor Angle - 1

Hai friends:
         Poor Angle- 1 welcomes you all.

“Only one who devotes himself to a cause with his
  whole strength and soul can be a true master.
  For this reason mastery demands all of a person.”
-Albert Einstein

It’s a common now that the teachers teach lessons presuming that the students knew the basics and prerequisites to grasp the core of the lecture. But the students hardly check that thing. Even if the teacher knew that the students are lacking the prerequisites he should not bother and move on satisfying himself that it’s his mistake that he is lacking what is needed to understand the concept. This is the present syntax.  The teacher has to move on as he has to complete the syllabus within the academic year/semester. Actually we have to understand one thing. The syllabus that is allotted for a particular semester/year can very well be completed within the period even if it is taken elaborately and through demonstration. In engineering colleges, the lecturers are taking classes in hurry but still complete only half of the syllabus. They expect their students to study the untaught lessons by themselves. As a result, most students underestimate their teachers and think “if we are able to study those untaught lessons by ourselves why can’t we study without classroom teaching”. They concluded that classroom teaching is unnecessary and go to classes for mere attendance. I request those students to never think like that. In fact, classroom teaching at its best will make the students to think far beyond the book. So in short, this poor angle is neither to blame the teachers nor the students. It just shows how an average student sees the classroom and what steps might be taken from both sides to provide the student an optimum angle of sight.
Well, there are several factors to deal with this problem. First we’ll see the factors with respect to teachers and concentrate on the students a little later. The first factor to deal with is “A teacher with no time”.
A teacher with no time:
Actually this in whole is not a factor here; the time is our first parameter to deal with.
No time at home:
As we see at the start, a master has to devote all his time in learning and teaching. Some of us may astonish on how to devote every quality minute in learning and teaching. I mention quality minute here because not all the time could possibly be spent but at least the best. In ancient education, the guru did devote all his time to the students and the students did so. The ancient society supported them. But now this could be completely ridiculous. Because the teacher has his own family, own children, own problems and duties to do with. Owing to the stress, the teachers can’t spend time in preparing a possibly best lecture and planned to teach with the knowledge he acquired in the past and show the mediocre performance at the play. I tell you one thing with my personal experience, how easy a topic may be, you will find a great variance between the home worked play and the direct play. So, in short, how stress a home environment may be, a teacher too has to do some homework. For this I didn’t blame the teachers nor I’ll do but because of this very important lacking, the teaching becomes mess.

No time at the Institution:
                Teachers do not have all the time to spend with the students. They have their own tight schedule in the institutions too. They have to take care of the data entry, assessments, attendance and indeed their Ph.D. works too. They have their own stress. We have to respect their schedule and make use of their quality time with us. Teachers on the other hand have to prioritize their works in which students should come first. Most teachers won’t. I’m sorry to say that most teachers do not have time consciousness and I beg you a pardon for pointing out this. They come to the class, tell whatever it is in the book mechanically and never even think of developing the students. In engineering colleges, they don’t teach Engineering but rather they teach how to score marks. They teach how to pass the exams and exams alone and never care about their interpersonal skills. Actually the students can read whatever it is there in the book, they just need to be discovered by themselves and teachers have to help them to discover themselves. Most teachers claim they find no time at the institution for all these things and that’s the reason I group these things under this factor. We will discuss more about the topic in a different dimension a little later.
                One thing we all have to understand. For teachers teaching should be a passion rather than profession. For students learning should be a passion rather than a duty. Then only these open errands will come into conclusion. If teaching becomes a passion, there will not be time related issues by the teachers anymore (may be hard to digest!!). It’s easy to tell you all these things through a blog and providing suggestions, but very hard to implement. So how about a case study. Poor angle is going to suggest possible solutions only via case studies. So read poor angle further and comment on it for its enhancement.
Sincerely,
Balaji.

Re:Introductory



Hai friends:
Happy New Year. Sorry for the long delay. In this New Year let’s start 2 new episodes. One is ‘Poor Angle’ and the other being Bachelor of Electronics. Poor angle is my analysis and case studies of classroom teaching. It reflects the mentality and thoughts of a student who can’t follow the teacher in a classroom.  Poor angle didn’t blame the teachers and students. Rather it will just show how an average student see the classroom and what steps might be taken from both teachers’ side and students’ side to provide him an optimum angle of sight. Bachelor of Electronics is the basic concepts of electronics. Much stuff is there in the internet regarding the basics of electronics. Most of the concepts are surely not new to us. But still can we guarantee that we are good in basics of electronics? No., we can’t. A deep knowledge of basics of electronics is a compulsory to amaze at the magic of electronics, its behavior, its mysterious characteristics and its application in a large scale. In this series of episode let’s start with the very basic and then move on further. Finally when we feel satisfied we can start relating quantum physics and electronics. One important thing to say: your comments are my support. Please do comment. Happy new year again.