Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
10 views36 pages

C Language Notes by Ad

The document provides comprehensive notes on the C programming language, covering its definition, history, and applications in software development. It explains key concepts such as programming languages, system software vs application software, and the structure of C programs, including variables, data types, and functions. Additionally, it discusses the importance of C in learning other programming languages and highlights the role of compilers and integrated development environments (IDEs) in programming.

Uploaded by

sr4674
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views36 pages

C Language Notes by Ad

The document provides comprehensive notes on the C programming language, covering its definition, history, and applications in software development. It explains key concepts such as programming languages, system software vs application software, and the structure of C programs, including variables, data types, and functions. Additionally, it discusses the importance of C in learning other programming languages and highlights the role of compilers and integrated development environments (IDEs) in programming.

Uploaded by

sr4674
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

BTPS KANPUR

C Language Notes
IT Company
Software Web Mobile
Devlopment Devlopment Devlopment
➢ Desktop
Application
No need to Install Install
➢ Install
Via Browser we ➢ With the help of
➢ Used can Access Internet.
Ex- throught Internet ➢ We can Access…
• MS Office
Ex- Ex-
• Goggle Chrome
• Gmail • Zomato
• Microsoft • Youtube • Swiggy
• Notepade • Amazon • Ola
• Tally • Snapdeal • WhatsApp
What is Language

, Language is a mode of communication that is


used to share ideas, opinions with each other.
For example

What is a Programming Language?


A programming language is a computer language
that is used by programmers (developers) to
communicate with computers. It is a set of
instructions written in any specific language ( C,
C++, Java, Python) to perform a specific task.
What is Programming

Computer programming is a medium for us to


communicate with computer, just like we use
hindi or English to communicate with each other.

Programming is a way for us to deliver our


instructions to the computer.
About C Language
➢ C (prononced /”Si”/- like the latter c) is a
general-purpose computer programming
language.

➢ It is created in the 1970s by Dennis Ritchie.

➢ It is very popular language, despite being old.

➢ C is strongly associated with UNIX, as it was


developed to write the UNIX operating system.
What is Program?

 set of instructions are


called as Program.

What is Application?

 set of Programes is called


as Application.
Why we Use Programming
Language?
➢ The main Purpose of using programming Language is
to develop different types of Applications such as-

1. Software Development
2. Website Development
3. Mobile Applciation,......

➢ if you want to write any program then you need any


one programming Language like c,c++,
java,c#,python.
Why Learn C ?
➢ It is one of the most popular Programming
language in the world.

➢ If you know C, you will have no problem learning


other popular programming language such as
Java, Python, C++, C# etc, as the sintex is similar.
What tyeps of Applciation we can
develop using c Programming
language?

 Using C Lang- we can develop any kind of


Software.
but there are two types of Software Development.

1. System Software
2. Application Software
System Software
 SS are those Soft which are design for System or
which are communicate with H/W Component or
activate system component is called as System
Software.
 Ex.OS,Drivers....
Application Software

 AS ARE THOSE Soft which are design for users not


for System is called as Applcation Soft..

 Ex- Ms Office,turbo c,WMP,VLc,tally,photoshop


corel draw , VLC, ...
IMP
Point:-
 using c Lang- it is recommonded to develop
System Software not Application Soft-.

➢to solve this Problem c++,java,python came in


market to develop Application Softwares.
What is main drawback of C/C++

➢The main drawback is Plateform dependent,


To overcome this problem java came in
Market and design the Application software
which is Plateform Indepnedent
Introduction of C PL

1. It is Programming Language(Computer Language).


2. It is High Level PL.
3. It is Case Sensitive PL.
C, C++,java,python,c#...[case sensiteve PL]
HTML,SQL(structure Query Language) [not
case sensitive].

4. Before C lang- B -Lang was there.


5- C is Developed by Dennis Ritchie in 1972 at Bell Labo in
US.
6- It is POP(Procedural oriented Programming Lang-).
7- Every PL have its own Compiler.
8- C is Compilative and Interprative PL where as Python is
only Interpreative PL
9- The name of C -compiler is TCC.exe.
10- C Program is run BY OS.
11- C is Platform(os) Dependent PL.
12- The Extention of C Prog-Language is .c
Q-1= Write a program to calculate area of square?
(side is given)
Q-2 =Write a program to calculate area of circle ?
(redius is given)

Q-3 Write a program to calculate perimeter of rectangle .


(Take side , a&b, from the user)

Q-4 Take a number(n) from user 7 output its cube


(n*n*n)
IDE
➢ An Integrated Devolopment Environment
(IDE) is a software application that provides
comprehensive facilities to computer
programmers for software development.

➢ An IDE normally consists of at least a source


code editor, build automation tools and
debugger.
Compiler
➢ A compiler is a computer program that translates
computer code written in one programming
language (the source language) into another
language (the target language).

➢ Compilers are not the only language processor used


to transform source programs.
Compilation
 A computer program that translates C code into
machine code .

Hello.c << C compiler << .exc(windows) / .out (linux & mac)


Compiler Interpriter

1. Scans the entire program 1. Translates the program


and translates it as a one statement at a time.
whole into machine code. 2. Considering it scans code
2. As it scans the code in
one line at a time, errors
are shown line by line.
one go, the errors (if any)
3. It does not convert source
are shown at the end
code into object code
together. instead it scans it line by
3. It converts the source line
code into object code.
4. Python, Ruby, Perl,
4. C, C++, C#, etc are SNOBOL, MATLAB,
programming languages etc are programming
that are compiler-based. languages that are
interpreter-based.
Programming Sturture of C Lang--
1- HeaderFiles #include<stdio.h> standard
input/output header file
2- Entry Point void main()
3- blocks {} {
4- Statements printf("my name is Anuj
shukla");
What is #?
it is preprocessor command ,always start with #.

include
include is a folder where all the header files
are present
#include
The #include preprocessor directive is used to paste
code of given file into current file.
what is Header File?
Header files is collection of predefined functions and
global variables.

➢<Stdio.h>
➢<Conio.h>
<stdio.h>
1. this header file provide us two imp functions to
perform input/output operation.

2. printf()--this function is used to print any message or


out put on to the console(output window).

3. scanf()--this function is used to take input from


user(keyboard input) or read the information
from user.
<conio.h>
▪ console Input/output
➢This header file provides us many imp functions
but two functions are very useful.
1. getch()-- to hold the output screen

2. clrscr()--to clear the screen..


many more functios in conio.h HeaderFile Also.

3. delline(),getche(),textcolor()....
function main()
it is the entry point.
our program excecution start from main function.

➢ blocks---{.....} block of code.

➢ statements--line of code
What is variables
➢ Variable is a name of memory location which stores
Some data.

1. Like as container.
2. Variable are case senstive
3. 1st character is alphabet or ‘-’ ( special character)
4. No comma / blank space
5. Its value can be changed, and it can be reused many times.

➢ variables are used to store differnt types of


data(value) but it depends upon datatype
Syntax:-
Datatype Variable_name=Value;

Example-
int a=20
int _=20;
float b=3.4;
double d=678.988;
char t='a';
Rules for defining variables
A variable can have alphabets, digits, and underscore.
can use these alphabets-

a-z
A-Z
0-9
(underscore)

Example:-
int abc=20; //valid
float xy12=40.2; //valid
int #xy=30; //invalid //no other special charater can be used..
int @xy=20 //invlid
float xy=20.3;
A variable name can start with the alphabet, and underscore
only. It can't start with a digit.
Example-
int _ab1=30; //valid
int 1abc=40; //not valid

No whitespace is allowed within the variable name.


Example-
int xyz=30; //valid
int xy z=40; //not valid //no space is allowed.

We can not use keywords or Reserved words as variable


name.
Example- int if=20; //invalid //becoz if is keyword
int Double=40 //valid
Keywords
 Reserved words that have Special meaning
to th compiler
➢ 32 keywords in C
Comments
 Lines that are not part of program.

➢ Single line \\
➢ Multiple lines /* */
People Review BEST

You might also like