<<<...FORM OF A C PROGRAM ...>>>
Form of a C program indicates how it has to be written.There are certain rules about the form of a C
program that are applicable to all C programs.
There are as under:
(a)Each instruction in a C program is written as a separate statement.
(b)The statements in a program must appear in the same order in which we wish them to be executed.
(c)Blank spaces may be inserted between two words to improve the readability of the statement.
(d)All statement should be in the lower case letters.
(e)Every C statement must end with a semicoon(;).Thus ; acts as a statement terminator.
(f)A C statemnte can be written anywhere inm a given line. That's why it is often called a free form
language.
(g)Usually each line contains one statemnet . However , you can write multiple statement in one line
, provided each statement is terminated with a ;.
<<<...COMMENTS IN A C PROGRAM..>>>
Comments are used in a C program to clarify either the purpose of the program or the purpose of some
statement on the progrma.It is a good practice to begin a program with a comment indicating the purpose
of the program,its author and the date on which the program was written.
<<< Here are a few tips for writing comments in a C program :
(a)Comments can be in a small case, capital or a combination. They should be enclosed within /* */.
Thus, the first statement in our program are comments.
(b) Comment cannot be nested.This means one comment cannot be written inside another comment.So following
comment is invalid.
/* Cal of Si /* Author: gekay date:25/03/2021*/*/
(c)A comment can be spilit over more than one line, as in
/* this comemnt has
three lines
in it */
(d)ANSI C permits comments to be written in a another way as follows:
//calculation of simple interest
//formula
and so on ......
in the next blog we will discuss about 'what is main()
variables and their usage
0 Comments