Computer Programming LAB 1 Tejalal Choudhary Asst. Prof, CSE Dept. tejalal.choudhary@sdbct.ac.in
Contents Flow Chart Algorithm History of “C” Programming Language Character set Comments Keywords Compilation and execution
Algorithm An algorithm is a sequence of instructions to solve a particular problem in finite number of steps. In mathematics and computer science, an algorithm is a self-contained step-by-step set of operations to be performed. It is a problem solving technique. Algorithm: Addition of two numbers Step 1 : START Step 2 : DECLARE VARIABLES Step 3 : READ VALUE OF VARIABLES Step 4 : CALCULATE SUM AS SUM = A+B Step 5 : DISPLAY SUM Step 6 : END
Flow Chart It is a diagrammatic representation that illustrates the sequence of operations to be performed to get the solution of a problem. Flowcharts are drawn in the early stages of formulating computer solutions. Flowcharts facilitate communication between programmers and business people. The flowchart is drawn according to defined rules and using standard flowchart symbols prescribed by the American National Standard Institute, Inc.
Flow Chart Symbols
Sample flow chart
Flow chart for sum of 2 numbers
History of C C is a programming language developed at AT & T’s Bell Laboratories of USA in 1972. It was designed and written by Dennis Ritchie. It is a general purpose programming language used in development of system software and application software.
Character Set Any alphabet, digit or special symbol used to represent information Alphabets Digits Symbols
Comments Single line //this is a comment Multi line /* this is a comment */
Keywords Also known as reserved words Meaning is already known to compiler Can not be used as user defined names