Computer
Programming And
Utilization
FEATURES OF ‘C’
O Denis Ritchie developed ‘C’ language . Previous
version was known as ‘B’ language.
O Important feature of ‘C’ language is it is portable,
portability we mean that program can be run on
any hardware machine.
O Other features are it is modular language,
supports bit-wise operations and does not
provide input-output statement.
O The bit-wise operations allow the programmer to
do the operations on data bit by bit , which is a
feature of machine language. Because of this
facility ,’C’ is known as MIDDLE LEVEL
LANGUAGE
O The other important feature of ‘c’ program is that
it is modular.
O The large problem is divided into small sub
problems.
O Each module is individually approached as
separate sub problem and solution is found.
O Then all the module are put together and the
solution of the large problem is derived .
O Because of the modularity support ,’c’ language
is also called as structured programming
language
STRUCTURE OF A ‘C’
PROGRAM
O Every ‘C’ program has to follow specific
structure of ‘c’ program must have at least
one function called main().
O The main() function has to control over the
other part of program.
O Execution of the program start from the
main() function.
O The ‘C’ program structure is given below:-
STRUCTURE OF A ‘C’
PROGRAM
Documentation
Header file section
Constants and Global variables
main ()
{
Statement(s)
)
User defined functions and procedures with their body
STRUCTURE OF A ‘C’
PROGRAM
Program:
/*Write a program print the message
Hello !*/
#include<stdio.h>
void main( )
{
printf(“Hello !”);
}
STRUCTURE OF A ‘C’
PROGRAM
Output :
Hello !
STRUCTURE OF A ‘C’
PROGRAM
O The line #include<stdio.h>includes the
header file named as stdio.h. This file is
necessary to be included in our program
whenever we are doing input–output
operations.
O The next line is void main() which includes
the main() function. The void keyword
indicates it does not return any value of
operating system.
O Within the brackets {and} the body of main()
function is written.
O The symbol { indicates start of the main
function, while symbol } for the end of the
program.
O The satement printf(“Hello!”);actually prints
the
Hello !
message on the screen.
O In ‘C’ all the statements must be terminated by
semicolon’;’ symbol.That is the reason why
there is semicolon after printf(“Hello!”).
Explanation of parts of ‘C’ program
Features of 'c' program

Features of 'c' program

  • 1.
  • 2.
    FEATURES OF ‘C’ ODenis Ritchie developed ‘C’ language . Previous version was known as ‘B’ language. O Important feature of ‘C’ language is it is portable, portability we mean that program can be run on any hardware machine. O Other features are it is modular language, supports bit-wise operations and does not provide input-output statement. O The bit-wise operations allow the programmer to do the operations on data bit by bit , which is a feature of machine language. Because of this facility ,’C’ is known as MIDDLE LEVEL LANGUAGE
  • 3.
    O The otherimportant feature of ‘c’ program is that it is modular. O The large problem is divided into small sub problems. O Each module is individually approached as separate sub problem and solution is found. O Then all the module are put together and the solution of the large problem is derived . O Because of the modularity support ,’c’ language is also called as structured programming language
  • 5.
    STRUCTURE OF A‘C’ PROGRAM O Every ‘C’ program has to follow specific structure of ‘c’ program must have at least one function called main(). O The main() function has to control over the other part of program. O Execution of the program start from the main() function. O The ‘C’ program structure is given below:-
  • 6.
    STRUCTURE OF A‘C’ PROGRAM Documentation Header file section Constants and Global variables main () { Statement(s) ) User defined functions and procedures with their body
  • 7.
    STRUCTURE OF A‘C’ PROGRAM Program: /*Write a program print the message Hello !*/ #include<stdio.h> void main( ) { printf(“Hello !”); }
  • 8.
    STRUCTURE OF A‘C’ PROGRAM Output : Hello !
  • 9.
    STRUCTURE OF A‘C’ PROGRAM O The line #include<stdio.h>includes the header file named as stdio.h. This file is necessary to be included in our program whenever we are doing input–output operations. O The next line is void main() which includes the main() function. The void keyword indicates it does not return any value of operating system.
  • 10.
    O Within thebrackets {and} the body of main() function is written. O The symbol { indicates start of the main function, while symbol } for the end of the program. O The satement printf(“Hello!”);actually prints the Hello ! message on the screen. O In ‘C’ all the statements must be terminated by semicolon’;’ symbol.That is the reason why there is semicolon after printf(“Hello!”).
  • 11.
    Explanation of partsof ‘C’ program