Friday, December 6, 2013

Difference between declaration and definition

Declaration
-----------------
      Declaration tells the type of the variable only. That is , it tells whether it is an int or a float or a char. But, the space needed for the variable is not allocated during declaration.
int a;
After this statement, the compiler knows that there is going to be a variable a of type 'int'. But no space is allocated.


Definitionl
--------------
        Space is allocated for the variable and some initial value is assigned.
int a=50;
Variable a is initialised and assigned a value. Only during this definition, space for the variable is allocated.

Note
--------
Redefinition is an error but redeclaration is not an error.



Tuesday, December 3, 2013

Hare and Tortoise

THE HARE AND THE TORTOISE


Once there lived a tortoise and a haughty hare in the forest. Everyday it used to tease the tortoise for its slowness and the tortoise was offended by his words. The hare repeatedly pointed out his slow nature and compared that with his swiftness.



One day, he had crossed his limits and added,"Shall we have a running race??? Can you compete with me???". The frustrated tortoise replied,"Ok. I will". The hare was surprised.



The day has come and the race started. The hare ran as fast as he can. He has covers almost half the distance.  The high handed hare felt over confident about his winning the race. So he thought of taking rest until the tortoise crosses his place.


But the fate did not favor the imperious hare. He slept. Though he was slow, the tortoise reached the place where the hare was sleeping. He saw the hare sleeping and increase his pace to reach the destination faster.


The hare woke up after a long time and was suddenly shocked when he realized that he had slept. He started running extremely fast towards the destination but to his disappointment, the tortoise had already reached the destination.



Moral of the Story : Slow and Steady Wins the Race.
                                  Its not a matter how slow you go until you stop.
                                  Don't underestimate others.
                                  Don't be overconfident.

The Feel of Missing

                                                 "Miss You" is the statement used by almost everyone in their day to day life. The feel of missing is common among relationships and its really a question of debate whether they mean when they say it. How many of those who frequently use this statement know the real meaning of the word 'Miss'. The word 'Miss' is closely associated with pain. Its the pain of someone's absence makes us utter the word 'Miss'.

      
                                                 Missing someone is when we feel empty without them. Missing is when we feel lonely without them. Missing is when your heart wishes his/her presence right then. Missing is not proportional to the time interval between the successive meets but its really proportional to the rate in which we need their presence when we do something.Missing is when it hurts a lot on thinking of the bountiful waiting time to meet. Yet,there is a strange soothing fact in missing that we feel pleased and better when the person whom we miss, misses us too. Pleasure in Pain. Its like a drop of rain in an arid desert. 

                                                  But, the pain is worse when we realize that we cant meet or ever have their presence again in our life. The pain of missing the dear ones in our life will definitely step into everyone's life and no one is an exception. The more we love, the more we miss. 

                                                   The pain is directly proportionate to the amount of love we have on them. Pain of missing chases everyone of us. It may have already attacked us. It may be attacking us at present or it may attack us in future. But, the point is it will surely attack us. The number of times we are attacked and the intensity of attack varies from person to person.

                                                     So, everybody should be ready always to face the attack and encounter the pain. We cant avoid the pain but we can prepare our self to face it. Those who mean when they say 'Miss You' would have felt the squeezing pain of heart and have understood that Time is the best healer for anything and everything.

                                                   My Dear, I miss you each and every second of my life. I feel nothing without you. When my eyes become watery, I realize that I am thinking of you. I miss you when the sun rises and the sun sets. I miss you when it it is hot and when it is cold. I miss you when i sleep and when i am awake. I miss you whenever i breathe. You are now out of my sight but you have never been out of my mind. Everyday my love for you increases and so the pain. Now, am under the attack and experiencing the pain and so i want to say you  'I Miss you' and I mean it.



                    -----  Dedicated to my dear one whom I miss a lot ------- 
                                                   

                                                








                                                  

Monday, December 2, 2013

C Aptitude 1

Question :  What will be the output of the following program?
          
                  #include<stdio.h>
                  int x=15;
                  void main()
                 {
                  int x=5;
                  printf("\n %d",x);
                 }

Answer : 5.

Reason : Local variable has higher priority over Global Variable


Question :     What will be the output of the following program?

                     #include<stdio.h>

                  int x=15;
                  void main()
                 {
                  int x=5;
                  {
                     int x=1;
                     printf("\n %d",x);
                 }
                }

Answer : 1

Reason  :  The variable that is more local has higher priority among all the local variables.