Skip to main content

A7- CONSTANTS AND VARIABLES

 

By pragyansharma polavarapu

As in algebra the most important things  in computer programming are“CONSTANTS” and   “VARIABLES”. They are the foundation bricks in computer programming. All computer programming is based on selecting names for CONSTANTS and  VARIABLES  and declaring the information at start of every software program .

 Let us take example of a big busy hotel of  100 rooms. The ten  floors have ten   rooms each .the rooms are neatly numbered AI to A10, B1 TO B10,C1 TO C10 and so on for all ten floors. Daily guests come and rent rooms for a day or two . Some new persons come and some of the earlier occupants  leave every day. For the hotel workers the names of the persons occupying the rooms  or even their faces are not important. They are guided only by the room number .

The manager simply  tells a  worker to take coffee to room A -9,  attend a  call from room F-4 etc. In language of mathematics the room numbers are called “CONSTANTS” as they remain constant and  unchanged. Only the persons inside change.The persons inside are the “VARIABLES”(though they may be having tough strong invariable unchanging mindsets!)

The great importance of CONSTANTS and VARIABLES in every mathematical program can be seen from following simple example.in computer the “software programs” are just like algebra equations .

(At the very start of program we should declare names/symbols indicating CONSTANTS and  VARIABLES. In example below ordinary numbers 1234… are CONSTANTS and a,b,c,k are VARIABLES)

Ex: 2a+3b+5c=k .

First we give  a=2,b=3 and c=4 and get an answer k 1

In a second problem we give a=20, b=30 and c=30. The answer is k 2

We get a different  value of k in each case . The computer’s power is colossal. Even if we give  2000 or 20,000  sets of values to a,b and c we get the 2000/20,000  values for k in a split second. This concept of constants and variables is basic to computer logic and is most necessary to understand how the computer’s digital brain works.

 

 

 

 

 

 

 

Comments

Popular posts from this blog

G5-MYTHOLOGY--STORY OF A WICKED KING-2

G5-MYTHOLOGY--STORY  OF A WICKED KING-2 By PragyanSharma Polavarapu Then a most wonderful thing happened . With unbearable and frightening thundering sounds the pillar broke vertically and out came a most frightening form jumping out of the pillar. It had a shining body drenching entire area in dazzling light. It had a heavy human body and a frightening angry head of a lion with wide open mouth and started roaring violently as if hungry . It searched for the frightened and shivering king and caught hold of him. It was far bigger than the dazed king who himself was of heavy build. It dragged the frightened king to the high threshold and with wild angry roars sat on the threshold, tore open the stomach of the king and started drinking the king's blood ! It was a most fearful sight! Even the gods who appeared there were too frightened to go near this angry lion form of Lord Vishnu.  The boy too was frightened but gained his composure and sang hymns to the god. The angry lion- g...

G10-THE TEMPLE AT PATHAGUTTA-2

THE   ANCIENT   ORIGINAL  LORD NARASIMHA   TEMPLE    By PragyanSharma Polavarapu   As mentioned earlier the area of Pathagutta temple is a vast stony surface formed by a series of big horizontally-lying boulders buried deep in the ground. Each boulder may perhaps be fifty meters long and only a little less wide! At some places two or three small room-size boulders are stacked one above the other by nature. Seeing the stacked boulders every person wonders how such gigantic stones were lifted at all. No humans can lift them. Simple rural people feel that it is nothing but one of god's great visible miracles. They feel that if they similarly arrange a little stack of stones one above another somewhere on the stony ground they surely would get god's grace. We can see scores of such tiny stone-stacks created with much devotion by devotees on the stony ground in isolated areas. Large numbers of people worship at pathagutta temple daily. Th...

G7-BOULDER RIDDEN HILLS-2

  BOULDER RIDDEN HILLS-2 By PragyanSharma Polavarapu A LITTLE OF GEOLOGY  There are some gigantic bald hills (not boulders but entire hills)- --Bhongir hill, Yadadri hill,Hanamkonda "Ekasila" hill (Warangal district) etc. Let us learn how the bald hills i.e. single stone dome hills of colossal size are formed. Scientists say that such hills are among the oldest hill types in the world and were created hundreds of millions of years ago. Scientists say that age of earth may be around 4500 million years i.e. 450 crore years! At that early time, the outer stone layers of earth (crust layers) were very soft like wheat flour dough but extremely hot. Scientists say that lying under this soft bending “plastic” outer stone layer --( extending for thousands of square miles in area on earth’s surface at that time)--- ,there was another extremely hard stone mass which did not soften and bend. This underlying hard stone mass pushed up the soft outer layers .This was a very slow proce...