C Language: Snehal Patil

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 12

C Language

Snehal Patil
Introduction

 C is a procedural programming language. It was initially developed by


Dennis Ritchie for creating system applications that directly interact
with the hardware devices such as drivers,kernels etc
 Most of compilers and JVM’s are written in C. C programming is
considered as the base for other programming languages like java ,c+
+,PHP… hence it is called as mother language.
 C is called middle-level language because it actually binds the gap
between machine level language and high level language.
Real-world application of C
programming-
1. Operating system
2. Embedded system
3. Drivers
4. Data base
5. Gaming and animation
Syntax-

#include<stdio.h>
#include<conio.h>
Void main()
{
statement;
}
Commands

 Pre-processor commands-
1. #include<> is a preprocessor command and is generally the very
first statement of any C program.

 Header files-
1. #include<stdio.h>
2. #include<conio.h>
Header files include definitions of functions and
variables which help us to write our program code easily by providing some
very useful readymade functuins.
Main function

 Void main()-
1. It is the entry point for execution in C program.
2. The void is a keyword that represents function will not
return any value.
Concepts-

 The curly braces{}-  Semicolon-


1. The curly braces {} after the 1. Each statement in c program
main() function encloses the must ends with a ;
body of main() function.
2. It is also known as statement
2. All the program statements terminator.
are placed inside the curly
braces.
 %d-  %i-
% d specifies the type of
%i specifies the type of
variable as decimal number.
integer.
Functions-
These two functions are used for input and output in C language. Both
functions are inbuilt library functions,defined in stdio.h

 Printf()-  Scanf()-
1. Stands for print formatted  Function that reads formatted
2. This function is used to print data from stdin.
the
character,string,float,integer,
octal and hexadecimal values
onto the output screen.
Functions-

getch() clrscr()
1. Stands for ‘get character.’ 1. Used to clear the console
2. Used to hold the output screen screen.
until the user presses on the
keyboard.
Keywords-

1.int
2.char
3.float for
17.
4.double const
18.
5.void if
19.
6.auto else
20.
7.register enum
21.
8.return Signed
22.
9.extern Unsigned
23.
goto
10. Static
24.
break
11. Size
25. of
continue
12. Short
26.
do
13. Struct
27.
switch
14. Union
28.
case
15. Typedef
29.
While
16. Volatile
30.
Default
31.
long
32.
Explanation

 Keywords are predefined, reserved words used in programming that


have special meaning to the compiler. Each of which is associated
with specific features.
 Keywords are part of the syntax and they cannot be used as an
identifier. For example
int money;
Here, int is a keyword that indicates money is a variable of type int
(integer)

You might also like