Skip to main content

Posts

Showing posts from March, 2019

Types of C constants

        C constants can be divided into two major categories    (a)   Primary Constants    (b)   Secondary Constants This  constants are further categorised as shown in figure 1 Figure 1 Rules for Constructing Integer Constants  An integer constant must have at least one digit.  It must not have a decimal point.  It can be either positive or negative.  If no sign precedes an integer constant, it is assumed to be positive.  No commas or blanks are allowed within an integer constants.  The allowable range for integer constants is -214783648 to 214783647 ( for C/C++ it is -32768 to 32767).              Ex. 4635                     +4234                    -956                    -8...

Getting started with C

          Communicating with a computer involves speaking the language the computer understands, which immediately rules out English as the language of communication with computer. However, there is a close analogy between learning English language and learning C language. The classical method of learning English is to first learn the alphabets used in the language, then learn to combine these alphabets to form words, which, in turn, are combined to form paragraphs. Learning C is similiar and easier as well. Instead of straight-away learning, how to write a programs, we must first know what alphabets, numbers and special symbols are used in C, then how using them, constants variables and keywords are constructed, and finally, how are these combined to form an instruction. A group of instructions would be combined later on to form a program. This is illustrated in figure1 below: Figure 1

What is 'C' ? or Introduction of 'C' language

             'C' is a programming language developed at AT&T's BELL Laboratories of USA in 1970. It was designed and written by a man named Daniel Ritchie. In the late seventies 'C' began to replace the more familiar language of that time like PL/L, ALGOL,etc.  Thus, without any advertisement, C's reputation spread and its pool of users grew .  Ritchie seems to have been rather surprised that so many progrramers were preferring C to older languages like - FORTRAN or PL/L, or the new ones like Pascal and APL. But, that's what really happened.              Possibly why C seems so popular is because it is reliable, simple and easy to understand & use. Moreover, in an industry where newer languages ,tools and technologies emerge and vanish day in and day out, a language that has survived for more than three decades has to be really good.