Institute - Uie Department-Academic Unit-2
Institute - Uie Department-Academic Unit-2
3
Scheme of Evaluation
Sr. Type of Assessment Weightage of actual Frequency of Task Final Weightage in Internal Remarks
No. Task conduct Assessment (Prorated
Marks)
7
Structure of C program
Structure of C program is
defined by set of rules called
protocol, to be followed by
programmer while writing C
program. All C programs are
having sections/parts which
are mentioned here.
8
ü Documentation Section
The documentation section consists of a set of comment lines, giving the name of
the program, the author and other details, which the programmer would like to use
later. The comments can be written in two ways:
a) Multi-line comment
/* This is a
multi-line
comment */
Date:10/06/2020 */
b) Single-line comment
// This is a single-line comment
// Author: Aman 9
STRUCTURE OF C PROGRAM-
EXAMPLE
• Sample text here (16)
#include<stdio.h>
#include<conio.h>
#include<math.h> 12
ü Definition Section
• The definition section defines all symbolic constants.
• A #define is a preprocessor compiler directive and not a statement.
Therefore #define lines should not end with a semicolon.
• Symbolic constants are usually written in uppercase so that they are
easily distinguished from lowercase variable names.
15
Rules to write c program
• All C statements must end with semicolon.
• C is case-sensitive. That is, upper case and lower case characters are
different. Generally the statements are typed in lowercase.
• C statement can be written in one line or it can split into multiple
lines.
• Braces must always match upon pairs, i.e., every opening brace { must
have a matching closing brace }.
• Every C program starts with main() function.
16
First example program:
Documentation
Pre-processor directive
main function
Begin
Statement
17
Need of compiler:
18
Compilation & Execution process File1.c
File1.i
File1.o or
File1.obj
File1.exe
Final output
19
KEYWORDS IN C
20
Summary
22
Assessment Questions:
Q Choose the correct option Q3 Which of the following is type of
an error:
Q1 Role of Linker is:
A) Syntax error
A) Link with compiler
B) Logic error
B) Link with system libraries C) Data error
C) Link with assembler D) All above
D) generate output
True/False T/F
Q9 Header file contains definition of predefined functions
Q10 Termination symbol is optional for statements written in
main()
24
Discussion forum.
Future Scope of C
https://www.youtube.com/watch?v=5Kg4q0Vq5UU
25
REFERENCES
Reference Books
[1] Programming in C by Reema Thareja.
[2] Programming in ANSI C by E. Balaguruswamy, Tata McGraw Hill.
[3] Programming with C (Schaum's Outline Series) by Byron Gottfried Jitender
Chhabra, Tata McGraw Hill.
[4] The C Programming Language by Brian W. Kernighan, Dennis Ritchie, Pearson
education.
Reference Website
[5] fresh2refresh.com. C Language - Learn C Programs From Basics |
Fresh2Refresh. [online] Available at:
https://fresh2refresh.com/c-programming/c-basic-program/
[6] GeeksforGeeks. C Language Introduction - GeeksforGeeks. [online] Available at:
https://www.geeksforgeeks.org/c-language-set-1-introduction/
Video Links:
NPTEL https://www.youtube.com/watch?v=VSU7EaHMzl8&list=PLJvIzs_rP6R73
WlvumJvCQJrOY3U5zq1j&index=5&t=615s
26
THANK YOU