6. • Comments can be place anywhere in a
program and are enclose between the
delimiters.
• Comments are generally used for
documentation. Comments ignore by
compiler.
Comments are-
i) Single line comments
ii) Multi-line comments
8. /* ADDITION PROGRAM
this is multi-line comment
all three lines ignore by compiler */
#include<stdio.h>
#include<conio.h>
void main()
{
int a=5,b=6;
printf(“%d + %d = %d”,a,b,(a+));
getch();
}
9.
10. Preprocessor directives are process through
preprocessor before the ‘C’ Source code passes
through compiler.
the commonly used preprocessor directives are-
#include and #define
* the #include is used for including the
header files.
* the # define is used to define symbolic
constant and macros.
11. Commonly used header files in #include preprocessor
directives are-
#include<stdio.h>
#include<conio.h>
These header files are used by the beginners and the
programmers.
12. # is a special symbol which is requested to compiler.
The nature of # is to request, which is used to request for the
compiler for the specific work.
For example- in mobiles-*123# if we include # with any number
then it run a USSD code or request.
If we not use # then with any number calling start.
You can try-
Dial any number with * and # in mobile then you find a code
running, it doesn’t make a call, it request.
Dial- *2345# or Dial- *12345* you find the difference.
13. * Now include means to include something
* Include means – add, insert or put in etc.
*Means that # request to include something.
* The something is <stdio.h> header file.
* Stdio.h means std stands for standard, io stands for
input output, and .h is the extension of header file.
Means that #include<stdio.h> is the preprocessor
directive which requests to include/add/ insert the
standard input output header file.
14. printf(); // used to print statements
scanf(); //used to get input from user
These are the basic function which is
used for beginner of the ‘C’
Programming.
The alternate also available of these
functions, it will discuss later.
15. The work of #include is same, but the <conio.h> is
differ from the <stdio.h>
conio.h stands for console input output header file.
Function of <conio.h>
clrscr(); // to clear output screen
getch(); // to hold the output screen
conio.h is basically work for the output screen.
22. Every ‘C’ Program has one or more
functions.
If a program has only ONE Function then
it must be main().
Execution of every ‘C’ program start with
main() function. It has two part,
declaration of local variables and
statements.
The scope of the local variables to that
function only.
Statements in the main() function are
executed one by one.
23. Library Function
(also called built-in function.
Eg- scanf(), printf(), gets(), puts() etc.)
User-Defined Functions
(these are the functions
which are created by the C
Programmer)
26. return type function name()
{
Function body;
}
void add(int a, int b)
{
printf(“add function with parameter”);
}
SYNTAX-
EXAMPLE
-
Function Definition
29. The characters that are used in ‘C’ Program
are ‘C’ Character set. Which are given below-
Alphabets- A,B,C,D,E,…………………..Z
a,b,c,d,e,f,……………………z
Digits- 0,1,2,3,4,5,6,7,8,9
Special character
30. Symbols Name Symbols Name Symbols Name
+ Plus ) Right
parenthesis
? Question
Mark
* Astrisk { Left curly
braces
& Ampersand
Backward slash } Right curly
braces
@ At the rate
/ Forward slash [ Left bracket $ Dollar sign
< Less than ] Right Bracket ` Tilde sign
> Greater than , Comma - Minus,
Hyphen
( Left parenthesis : Colon % Percentage
= Equal sign ; Semi-colon | Vertical bar
. Period ‘ ‘ Single
Quotes
^ Caveat sign
“ “ Double quotes ! Exclamation # Hash