SlideShare a Scribd company logo
C Programming Language 
tutorial 
Powered by:-www.javatpoint.com
What is c language:- 
C is mother language of all programming 
language. 
 It is system programming language. 
 It is procedure-oriented programming 
language. 
 It is also called mid level programming 
language.
History of c language:- 
C programming language was developed in 
1972 by Dennis Ritchie at bell laboratories of 
AT&T(American Telephone & Telegraph), 
located in U.S.A. 
 Dennis Ritchie is known as founder of c 
language. 
 It was developed to be used in UNIX 
Operating system. 
 It inherits many features of previous 
languages such as B and BPCL.
Language year Developed By 
ALGOL 1960 International Group 
BPCL 1967 Martin Richards 
B 1970 Ken Thompson 
Traditional C 1972 Dennis Ritchie 
K & R C 1978 Kernighan & Dennis 
Ritchie 
ANSI C 1989 ANSI Committee 
ANSI/ISO C 1990 ISO Committee 
C99 1999 Standardization 
Committee
Features of C Language:- 
There are many features of c language are given below. 
1) Simple 
2) Machine Independent or Portable 
3) Mid-level programming language 
4) structured programming language 
5) Rich Library 
6) Memory Management 
7) Fast Speed 
8) Pointers 
9) Recursion 
10) Extensible
First Program of C Language:- 
#include <stdio.h> 
#include <conio.h> 
void main(){ 
printf("Hello C Language"); 
getch(); 
}
Describe the C Program:- 
 #include <stdio.h> includes the standard input 
output library functions. The printf() function is defined in 
stdio.h . 
 #include <conio.h> includes the console input 
output library functions. The getch() function is defined in 
conio.h file. 
 void main() The main() function is the entry point of 
every program in c language. The void keyword specifies 
that it returns no value. 
 printf() The printf() function is used to print data on the 
console. 
 getch() The getch() function asks for a single 
character. Until you press any key, it blocks the screen.
Output of Program is:- 
Hello C Language
Input output function:- 
 There are two input output function of c 
language. 
1) First is printf() 
2) Second is scanf() 
 printf() function is used for output. It prints the 
given statement to the console. 
 Syntax of printf() is given below: 
 printf(“format string”,arguments_list); 
 Format string can be %d(integer), 
%c(character), %s(string), %f(float) etc.
scanf() Function: is used for input. It 
reads the input data from console. 
 scanf(“format string”,argument_list); 
Note:-See more example of input-output 
function on:-www.javatpoint.com/printf-scanf
Data types in C language:- 
There are four types of data types in C 
language. 
Types Data Types 
Basic Data Type int, char, float, double 
Derived Data Type array, pointer, structure, union 
Enumeration Data Type enum 
Void Data Type void
Keywords in C Language:- 
A keyword is a reserved word. You 
cannot use it as a variable name, constant 
name etc. 
There are 32 keywords in C language as 
given below: 
auto break case char const continu 
e 
default do 
double else enum extern float for goto if 
int long register return short signed sizeof static 
struct switch typedef union unsigned void volatile while
Operators in C language:- 
 There are following types of operators to perform 
different types of operations in C language. 
1) Arithmetic Operators 
2) Relational Operators 
3) Shift Operators 
4) Logical Operators 
5) Bitwise Operators 
6) Ternary or Conditional Operators 
7) Assignment Operator 
8) Misc Operator
Control statement in C language:- 
1) if-else 
2) switch 
3) loops 
4) do-while loop 
5) while loop 
6) for loop 
7) break 
8) continue
C if else statement:- 
There are many ways to use if statement 
in C language: 
1) If statement 
2) If-else statement 
3) If else-if ladder 
4) Nested if
if statement:- 
 In if statement is used to execute the 
code if condition is true. 
syntax:- 
if(expression){ 
//code to be execute 
}
If else statement:- 
The if-else statement is used to execute 
the code if condition is true or false. 
Syntax: 
if(expression){ 
//code to be executed if condition is true 
}else{ 
//code to be executed if condition is false 
}
If else-if ladder Statement:- 
The if else-if statement is used to execute one code from multiple conditions. 
Syntax: 
if(condition1){ 
//code to be executed if condition1 is true 
}else if(condition2){ 
//code to be executed if condition2 is true 
} 
else if(condition3){ 
//code to be executed if condition3 is true 
} 
... 
else{ 
//code to be executed if all the conditions are false 
}
if else-if ladder Statement:- 
 Syntax: 
if(condition1){ 
//code to be executed if condition1 is true 
}else if(condition2){ 
//code to be executed if condition2 is true 
} 
else if(condition3){ 
//code to be executed if condition3 is true 
} 
... 
else{ 
//code to be executed if all the conditions are false 
}
C Switch Statement:- 
 Syntax: 
switch(expression){ 
case value1: 
//code to be executed; 
break; //optional 
case value2: 
//code to be executed; 
break; //optional 
...... 
default: 
code to be executed if all cases are not matched; 
}
Loops in C language:- 
Loops are used to execute a block of code 
or a part of program of the program 
several times. 
Types of loops in C language:- 
There are 3 types of loops in c language. 
1) do while 
2) while 
3) for
do-while loop in C:- 
 It is better if you have to execute the 
code at least once. 
Syntax:- 
do{ 
//code to be executed 
}while(condition);
while loop in c language:- 
 It is better if number of iteration is not 
known by the user. 
Syntax:- 
while(condition){ 
//code to be executed 
}
For loop in C language:- 
 It is good if number of iteration is known 
by the user. 
Syntax:- 
for(initialization;condition;incr/decr){ 
//code to be executed 
}
C break statement:- 
 it is used to break the execution of loop 
(while, do while and for) and switch case. 
Syntax:- 
jump-statement; 
break;
Continue statement in C language:- 
 it is used to continue the execution of loop 
(while, do while and for). It is used with if 
condition within the loop. 
Syntax:- 
jump-statement; 
continue; 
Note:- you can see the example of above 
all control statements on 
www.javatpoint.com/c-if else.
Functions in C language:- 
To perform any task, we can create 
function. A function can be called many 
times. It provides modularity and 
code reusability. 
Advantage of function:- 
1) Code Resuability 
2) Code optimization
Syntax to declare function:- 
return_type function_name(data_type para 
meter...){ 
//code to be executed 
} 
Syntax to call function:- 
variable=function_name(arguments...);
Call by value in C language:- 
In call by value, value being passed to the function is locally 
stored by the function parameter in stack memory location. 
If you change the value of function parameter, it is 
changed for the current function only. It will not change the 
value of variable inside the caller method such as main().
Example of call by value:- 
#include <stdio.h> 
#include <conio.h> 
void change(int num) { 
printf("Before adding value inside function num=%d n",num); 
num=num+100; 
printf("After adding value inside function num=%d n", num); 
} 
int main() { 
int x=100; 
clrscr(); 
printf("Before function call x=%d n", x); 
change(x);//passing value in function 
printf("After function call x=%d n", x); 
getch(); 
return 0; 
}
Output:- 
Before function call x=100 
 Before adding value inside function 
num=100 
After adding value inside function 
num=200 
After function call x=100
Call by reference in C:- 
 In call by reference, original value is 
modified because we pass reference 
(address).
Example of call by Reference:- 
#include <stdio.h> 
#include <conio.h> 
void change(int *num) { 
printf("Before adding value inside function num=%d n",*num); 
(*num) += 100; 
printf("After adding value inside function num=%d n", *num); 
} 
int main() { 
int x=100; 
clrscr(); 
printf("Before function call x=%d n", x); 
change(&x);//passing reference in function 
printf("After function call x=%d n", x); 
getch(); 
return 0; 
}
Output:- 
Before function call x=100 
Before adding value inside function 
num=100 
After adding value inside function 
num=200 
After function call x=200
Recursion in C:- 
 A function that calls itself, and doen't perform 
any task after function call, is know as tail 
recursion. In tail recursion, we generally call 
the same function with return statement. 
Syntax:- 
recursionfunction(){ 
recursionfunction();//calling self function 
}
Array in C:- 
 Array in C language is a collection or group of 
elements (data). All the elements of array 
are homogeneous(similar). It has contiguous memory 
location. 
Declaration of array:- 
 data_type array_name[array_size]; 
Eg:- 
 int marks[7]; 
Types of array:- 
1) 1-D Array 
2) 2-D Array
Advantage of array:- 
1) Code Optimization 
2) Easy to traverse data 
3) Easy to sort data 
4) Random Access
2-D Array in C:- 
2-d Array is represented in the form of 
rows and columns, also known as matrix. 
It is also known as array of arrays or list 
of arrays. 
Declaration of 2-d array:- 
data_type array_name[size1][size2];
Initialization of 2-d array:- 
int arr[3][4]={{1,2,3,4},{2,3,4,5},{3,4, 
5,6}};

More Related Content

What's hot (20)

Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
ABHISHEK fulwadhwa
 
Data Type in C Programming
Data Type in C ProgrammingData Type in C Programming
Data Type in C Programming
Qazi Shahzad Ali
 
Variables in C Programming
Variables in C ProgrammingVariables in C Programming
Variables in C Programming
programming9
 
Chapter1 c programming data types, variables and constants
Chapter1 c programming   data types, variables and constantsChapter1 c programming   data types, variables and constants
Chapter1 c programming data types, variables and constants
vinay arora
 
User defined functions in C
User defined functions in CUser defined functions in C
User defined functions in C
Harendra Singh
 
Functions in c language
Functions in c language Functions in c language
Functions in c language
tanmaymodi4
 
C presentation book
C presentation bookC presentation book
C presentation book
krunal1210
 
Introduction to Basic C programming 01
Introduction to Basic C programming 01Introduction to Basic C programming 01
Introduction to Basic C programming 01
Wingston
 
C basics
C   basicsC   basics
C basics
thirumalaikumar3
 
Basic structure of c programming
Basic structure of c programmingBasic structure of c programming
Basic structure of c programming
TejaswiB4
 
CONDITIONAL STATEMENT IN C LANGUAGE
CONDITIONAL STATEMENT IN C LANGUAGECONDITIONAL STATEMENT IN C LANGUAGE
CONDITIONAL STATEMENT IN C LANGUAGE
Ideal Eyes Business College
 
Character set of c
Character set of cCharacter set of c
Character set of c
Chandrapriya Rediex
 
Structures in c language
Structures in c languageStructures in c language
Structures in c language
tanmaymodi4
 
Data types in C language
Data types in C languageData types in C language
Data types in C language
kashyap399
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C Programming
Shuvongkor Barman
 
Features of c language 1
Features of c language 1Features of c language 1
Features of c language 1
srmohan06
 
constants, variables and datatypes in C
constants, variables and datatypes in Cconstants, variables and datatypes in C
constants, variables and datatypes in C
Sahithi Naraparaju
 
Data types in C
Data types in CData types in C
Data types in C
Tarun Sharma
 
Interface in java ,multiple inheritance in java, interface implementation
Interface in java ,multiple inheritance in java, interface implementationInterface in java ,multiple inheritance in java, interface implementation
Interface in java ,multiple inheritance in java, interface implementation
HoneyChintal
 
C programming notes.pdf
C programming notes.pdfC programming notes.pdf
C programming notes.pdf
AdiseshaK
 
Data Type in C Programming
Data Type in C ProgrammingData Type in C Programming
Data Type in C Programming
Qazi Shahzad Ali
 
Variables in C Programming
Variables in C ProgrammingVariables in C Programming
Variables in C Programming
programming9
 
Chapter1 c programming data types, variables and constants
Chapter1 c programming   data types, variables and constantsChapter1 c programming   data types, variables and constants
Chapter1 c programming data types, variables and constants
vinay arora
 
User defined functions in C
User defined functions in CUser defined functions in C
User defined functions in C
Harendra Singh
 
Functions in c language
Functions in c language Functions in c language
Functions in c language
tanmaymodi4
 
C presentation book
C presentation bookC presentation book
C presentation book
krunal1210
 
Introduction to Basic C programming 01
Introduction to Basic C programming 01Introduction to Basic C programming 01
Introduction to Basic C programming 01
Wingston
 
Basic structure of c programming
Basic structure of c programmingBasic structure of c programming
Basic structure of c programming
TejaswiB4
 
Structures in c language
Structures in c languageStructures in c language
Structures in c language
tanmaymodi4
 
Data types in C language
Data types in C languageData types in C language
Data types in C language
kashyap399
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C Programming
Shuvongkor Barman
 
Features of c language 1
Features of c language 1Features of c language 1
Features of c language 1
srmohan06
 
constants, variables and datatypes in C
constants, variables and datatypes in Cconstants, variables and datatypes in C
constants, variables and datatypes in C
Sahithi Naraparaju
 
Interface in java ,multiple inheritance in java, interface implementation
Interface in java ,multiple inheritance in java, interface implementationInterface in java ,multiple inheritance in java, interface implementation
Interface in java ,multiple inheritance in java, interface implementation
HoneyChintal
 
C programming notes.pdf
C programming notes.pdfC programming notes.pdf
C programming notes.pdf
AdiseshaK
 

Viewers also liked (10)

Basic of web design
Basic of web designBasic of web design
Basic of web design
Singsys Pte Ltd
 
Overview of c language
Overview of c languageOverview of c language
Overview of c language
shalini392
 
Web design - HTML (Hypertext Markup Language) introduction
Web design - HTML (Hypertext Markup Language) introductionWeb design - HTML (Hypertext Markup Language) introduction
Web design - HTML (Hypertext Markup Language) introduction
Mustafa Kamel Mohammadi
 
WEB PAGE DESIGN USING HTML
WEB PAGE DESIGN USING HTMLWEB PAGE DESIGN USING HTML
WEB PAGE DESIGN USING HTML
Sneha Mukherjee
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
vikasgaur31
 
C notes.pdf
C notes.pdfC notes.pdf
C notes.pdf
Durga Padma
 
C language ppt
C language pptC language ppt
C language ppt
Ğäùråv Júñêjå
 
Basics of C programming
Basics of C programmingBasics of C programming
Basics of C programming
avikdhupar
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMING
Abhishek Dwivedi
 
Ad

Similar to C Programming Language Tutorial for beginners - JavaTpoint (20)

Introduction to c
Introduction to cIntroduction to c
Introduction to c
amol_chavan
 
C programming language tutorial
C programming language tutorial C programming language tutorial
C programming language tutorial
javaTpoint s
 
C_Progragramming_language_Tutorial_ppt_f.pptx
C_Progragramming_language_Tutorial_ppt_f.pptxC_Progragramming_language_Tutorial_ppt_f.pptx
C_Progragramming_language_Tutorial_ppt_f.pptx
maaithilisaravanan
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
Rutvik Pensionwar
 
C programmimng basic.ppt
C programmimng basic.pptC programmimng basic.ppt
C programmimng basic.ppt
ASIT Education
 
Complete c programming presentation
Complete c programming presentationComplete c programming presentation
Complete c programming presentation
nadim akber
 
C language (1).pptxC language (1C language (1).pptx).pptx
C language (1).pptxC language (1C language (1).pptx).pptxC language (1).pptxC language (1C language (1).pptx).pptx
C language (1).pptxC language (1C language (1).pptx).pptx
RutviBaraiya
 
C Programming Unit-2
C Programming Unit-2C Programming Unit-2
C Programming Unit-2
Vikram Nandini
 
What is c
What is cWhat is c
What is c
Nitesh Saitwal
 
C programming language:- Introduction to C Programming - Overview and Importa...
C programming language:- Introduction to C Programming - Overview and Importa...C programming language:- Introduction to C Programming - Overview and Importa...
C programming language:- Introduction to C Programming - Overview and Importa...
SebastianFrancis13
 
Introduction to C Unit 1
Introduction to C Unit 1Introduction to C Unit 1
Introduction to C Unit 1
Dr. SURBHI SAROHA
 
c-programming functions in c programming.pptx
c-programming functions in c programming.pptxc-programming functions in c programming.pptx
c-programming functions in c programming.pptx
SasikalaP8
 
C_Language_PS&PC_Notes.ppt
C_Language_PS&PC_Notes.pptC_Language_PS&PC_Notes.ppt
C_Language_PS&PC_Notes.ppt
ganeshkarthy
 
C introduction by thooyavan
C introduction by  thooyavanC introduction by  thooyavan
C introduction by thooyavan
Thooyavan Venkatachalam
 
Programming in C
Programming in CProgramming in C
Programming in C
Nishant Munjal
 
C programing Tutorial
C programing TutorialC programing Tutorial
C programing Tutorial
Mahira Banu
 
Library management system
Library management systemLibrary management system
Library management system
SHARDA SHARAN
 
Elements of programming
Elements of programmingElements of programming
Elements of programming
baabtra.com - No. 1 supplier of quality freshers
 
C Language ppt create by Anand & Sager.pptx
C Language ppt create by Anand & Sager.pptxC Language ppt create by Anand & Sager.pptx
C Language ppt create by Anand & Sager.pptx
kumaranand07297
 
Basics of C Prog Lang.pdf
Basics of C Prog Lang.pdfBasics of C Prog Lang.pdf
Basics of C Prog Lang.pdf
KalighatOkira
 
Introduction to c
Introduction to cIntroduction to c
Introduction to c
amol_chavan
 
C programming language tutorial
C programming language tutorial C programming language tutorial
C programming language tutorial
javaTpoint s
 
C_Progragramming_language_Tutorial_ppt_f.pptx
C_Progragramming_language_Tutorial_ppt_f.pptxC_Progragramming_language_Tutorial_ppt_f.pptx
C_Progragramming_language_Tutorial_ppt_f.pptx
maaithilisaravanan
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
Rutvik Pensionwar
 
C programmimng basic.ppt
C programmimng basic.pptC programmimng basic.ppt
C programmimng basic.ppt
ASIT Education
 
Complete c programming presentation
Complete c programming presentationComplete c programming presentation
Complete c programming presentation
nadim akber
 
C language (1).pptxC language (1C language (1).pptx).pptx
C language (1).pptxC language (1C language (1).pptx).pptxC language (1).pptxC language (1C language (1).pptx).pptx
C language (1).pptxC language (1C language (1).pptx).pptx
RutviBaraiya
 
C programming language:- Introduction to C Programming - Overview and Importa...
C programming language:- Introduction to C Programming - Overview and Importa...C programming language:- Introduction to C Programming - Overview and Importa...
C programming language:- Introduction to C Programming - Overview and Importa...
SebastianFrancis13
 
c-programming functions in c programming.pptx
c-programming functions in c programming.pptxc-programming functions in c programming.pptx
c-programming functions in c programming.pptx
SasikalaP8
 
C_Language_PS&PC_Notes.ppt
C_Language_PS&PC_Notes.pptC_Language_PS&PC_Notes.ppt
C_Language_PS&PC_Notes.ppt
ganeshkarthy
 
C programing Tutorial
C programing TutorialC programing Tutorial
C programing Tutorial
Mahira Banu
 
Library management system
Library management systemLibrary management system
Library management system
SHARDA SHARAN
 
C Language ppt create by Anand & Sager.pptx
C Language ppt create by Anand & Sager.pptxC Language ppt create by Anand & Sager.pptx
C Language ppt create by Anand & Sager.pptx
kumaranand07297
 
Basics of C Prog Lang.pdf
Basics of C Prog Lang.pdfBasics of C Prog Lang.pdf
Basics of C Prog Lang.pdf
KalighatOkira
 
Ad

More from JavaTpoint.Com (9)

5 Reason, Why Python Popular.pdf
5 Reason, Why Python Popular.pdf5 Reason, Why Python Popular.pdf
5 Reason, Why Python Popular.pdf
JavaTpoint.Com
 
History and Versions of Java Programming.pdf
History and Versions of Java Programming.pdfHistory and Versions of Java Programming.pdf
History and Versions of Java Programming.pdf
JavaTpoint.Com
 
4 Network Certifications for Your IT Career in 2022.pdf
4 Network Certifications for Your IT Career in 2022.pdf4 Network Certifications for Your IT Career in 2022.pdf
4 Network Certifications for Your IT Career in 2022.pdf
JavaTpoint.Com
 
Skills required for an IoT Developer.pdf
Skills required for an IoT Developer.pdfSkills required for an IoT Developer.pdf
Skills required for an IoT Developer.pdf
JavaTpoint.Com
 
CCNA Interview Questions and Answer ppt - JavaTpoint
CCNA Interview Questions and Answer ppt - JavaTpointCCNA Interview Questions and Answer ppt - JavaTpoint
CCNA Interview Questions and Answer ppt - JavaTpoint
JavaTpoint.Com
 
Jsoup Tutorial for Beginners - Javatpoint
Jsoup Tutorial for Beginners - JavatpointJsoup Tutorial for Beginners - Javatpoint
Jsoup Tutorial for Beginners - Javatpoint
JavaTpoint.Com
 
Cloud computing tutorial for beginners
Cloud computing tutorial for beginnersCloud computing tutorial for beginners
Cloud computing tutorial for beginners
JavaTpoint.Com
 
Get an Android tutorial for beginners
Get an Android tutorial for beginnersGet an Android tutorial for beginners
Get an Android tutorial for beginners
JavaTpoint.Com
 
What is Ajax technology?
What is Ajax technology?What is Ajax technology?
What is Ajax technology?
JavaTpoint.Com
 
5 Reason, Why Python Popular.pdf
5 Reason, Why Python Popular.pdf5 Reason, Why Python Popular.pdf
5 Reason, Why Python Popular.pdf
JavaTpoint.Com
 
History and Versions of Java Programming.pdf
History and Versions of Java Programming.pdfHistory and Versions of Java Programming.pdf
History and Versions of Java Programming.pdf
JavaTpoint.Com
 
4 Network Certifications for Your IT Career in 2022.pdf
4 Network Certifications for Your IT Career in 2022.pdf4 Network Certifications for Your IT Career in 2022.pdf
4 Network Certifications for Your IT Career in 2022.pdf
JavaTpoint.Com
 
Skills required for an IoT Developer.pdf
Skills required for an IoT Developer.pdfSkills required for an IoT Developer.pdf
Skills required for an IoT Developer.pdf
JavaTpoint.Com
 
CCNA Interview Questions and Answer ppt - JavaTpoint
CCNA Interview Questions and Answer ppt - JavaTpointCCNA Interview Questions and Answer ppt - JavaTpoint
CCNA Interview Questions and Answer ppt - JavaTpoint
JavaTpoint.Com
 
Jsoup Tutorial for Beginners - Javatpoint
Jsoup Tutorial for Beginners - JavatpointJsoup Tutorial for Beginners - Javatpoint
Jsoup Tutorial for Beginners - Javatpoint
JavaTpoint.Com
 
Cloud computing tutorial for beginners
Cloud computing tutorial for beginnersCloud computing tutorial for beginners
Cloud computing tutorial for beginners
JavaTpoint.Com
 
Get an Android tutorial for beginners
Get an Android tutorial for beginnersGet an Android tutorial for beginners
Get an Android tutorial for beginners
JavaTpoint.Com
 
What is Ajax technology?
What is Ajax technology?What is Ajax technology?
What is Ajax technology?
JavaTpoint.Com
 

Recently uploaded (20)

Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
EduSkills OECD
 
State institute of educational technology
State institute of educational technologyState institute of educational technology
State institute of educational technology
vp5806484
 
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
parmarjuli1412
 
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
National Information Standards Organization (NISO)
 
Hemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptxHemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptx
Arshad Shaikh
 
Stewart Butler - OECD - How to design and deliver higher technical education ...
Stewart Butler - OECD - How to design and deliver higher technical education ...Stewart Butler - OECD - How to design and deliver higher technical education ...
Stewart Butler - OECD - How to design and deliver higher technical education ...
EduSkills OECD
 
Nice Dream.pdf /
Nice Dream.pdf                              /Nice Dream.pdf                              /
Nice Dream.pdf /
ErinUsher3
 
Parenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independenceParenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independence
Pooky Knightsmith
 
Smart Borrowing: Everything You Need to Know About Short Term Loans in India
Smart Borrowing: Everything You Need to Know About Short Term Loans in IndiaSmart Borrowing: Everything You Need to Know About Short Term Loans in India
Smart Borrowing: Everything You Need to Know About Short Term Loans in India
fincrifcontent
 
Search Engine Optimization (SEO) for Website Success
Search Engine Optimization (SEO) for Website SuccessSearch Engine Optimization (SEO) for Website Success
Search Engine Optimization (SEO) for Website Success
Muneeb Rana
 
How to Create Quotation Templates Sequence in Odoo 18 Sales
How to Create Quotation Templates Sequence in Odoo 18 SalesHow to Create Quotation Templates Sequence in Odoo 18 Sales
How to Create Quotation Templates Sequence in Odoo 18 Sales
Celine George
 
june 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptxjune 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptx
roger malina
 
EUPHORIA GENERAL QUIZ FINALS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025
EUPHORIA GENERAL QUIZ FINALS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025EUPHORIA GENERAL QUIZ FINALS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025
EUPHORIA GENERAL QUIZ FINALS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025
Quiz Club of PSG College of Arts & Science
 
"Hymenoptera: A Diverse and Fascinating Order".pptx
"Hymenoptera: A Diverse and Fascinating Order".pptx"Hymenoptera: A Diverse and Fascinating Order".pptx
"Hymenoptera: A Diverse and Fascinating Order".pptx
Arshad Shaikh
 
Optimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptxOptimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptx
UrmiPrajapati3
 
Fatman Book HD Pdf by aayush songare.pdf
Fatman Book  HD Pdf by aayush songare.pdfFatman Book  HD Pdf by aayush songare.pdf
Fatman Book HD Pdf by aayush songare.pdf
Aayush Songare
 
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptxSEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
PoojaSen20
 
LDMMIA Reiki Yoga S8 Free Workshop Grad Level
LDMMIA Reiki Yoga S8 Free Workshop Grad LevelLDMMIA Reiki Yoga S8 Free Workshop Grad Level
LDMMIA Reiki Yoga S8 Free Workshop Grad Level
LDM & Mia eStudios
 
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
SweetytamannaMohapat
 
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptxPests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Arshad Shaikh
 
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
EduSkills OECD
 
State institute of educational technology
State institute of educational technologyState institute of educational technology
State institute of educational technology
vp5806484
 
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
parmarjuli1412
 
Hemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptxHemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptx
Arshad Shaikh
 
Stewart Butler - OECD - How to design and deliver higher technical education ...
Stewart Butler - OECD - How to design and deliver higher technical education ...Stewart Butler - OECD - How to design and deliver higher technical education ...
Stewart Butler - OECD - How to design and deliver higher technical education ...
EduSkills OECD
 
Nice Dream.pdf /
Nice Dream.pdf                              /Nice Dream.pdf                              /
Nice Dream.pdf /
ErinUsher3
 
Parenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independenceParenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independence
Pooky Knightsmith
 
Smart Borrowing: Everything You Need to Know About Short Term Loans in India
Smart Borrowing: Everything You Need to Know About Short Term Loans in IndiaSmart Borrowing: Everything You Need to Know About Short Term Loans in India
Smart Borrowing: Everything You Need to Know About Short Term Loans in India
fincrifcontent
 
Search Engine Optimization (SEO) for Website Success
Search Engine Optimization (SEO) for Website SuccessSearch Engine Optimization (SEO) for Website Success
Search Engine Optimization (SEO) for Website Success
Muneeb Rana
 
How to Create Quotation Templates Sequence in Odoo 18 Sales
How to Create Quotation Templates Sequence in Odoo 18 SalesHow to Create Quotation Templates Sequence in Odoo 18 Sales
How to Create Quotation Templates Sequence in Odoo 18 Sales
Celine George
 
june 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptxjune 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptx
roger malina
 
"Hymenoptera: A Diverse and Fascinating Order".pptx
"Hymenoptera: A Diverse and Fascinating Order".pptx"Hymenoptera: A Diverse and Fascinating Order".pptx
"Hymenoptera: A Diverse and Fascinating Order".pptx
Arshad Shaikh
 
Optimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptxOptimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptx
UrmiPrajapati3
 
Fatman Book HD Pdf by aayush songare.pdf
Fatman Book  HD Pdf by aayush songare.pdfFatman Book  HD Pdf by aayush songare.pdf
Fatman Book HD Pdf by aayush songare.pdf
Aayush Songare
 
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptxSEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
PoojaSen20
 
LDMMIA Reiki Yoga S8 Free Workshop Grad Level
LDMMIA Reiki Yoga S8 Free Workshop Grad LevelLDMMIA Reiki Yoga S8 Free Workshop Grad Level
LDMMIA Reiki Yoga S8 Free Workshop Grad Level
LDM & Mia eStudios
 
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
SweetytamannaMohapat
 
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptxPests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Arshad Shaikh
 

C Programming Language Tutorial for beginners - JavaTpoint

  • 1. C Programming Language tutorial Powered by:-www.javatpoint.com
  • 2. What is c language:- C is mother language of all programming language.  It is system programming language.  It is procedure-oriented programming language.  It is also called mid level programming language.
  • 3. History of c language:- C programming language was developed in 1972 by Dennis Ritchie at bell laboratories of AT&T(American Telephone & Telegraph), located in U.S.A.  Dennis Ritchie is known as founder of c language.  It was developed to be used in UNIX Operating system.  It inherits many features of previous languages such as B and BPCL.
  • 4. Language year Developed By ALGOL 1960 International Group BPCL 1967 Martin Richards B 1970 Ken Thompson Traditional C 1972 Dennis Ritchie K & R C 1978 Kernighan & Dennis Ritchie ANSI C 1989 ANSI Committee ANSI/ISO C 1990 ISO Committee C99 1999 Standardization Committee
  • 5. Features of C Language:- There are many features of c language are given below. 1) Simple 2) Machine Independent or Portable 3) Mid-level programming language 4) structured programming language 5) Rich Library 6) Memory Management 7) Fast Speed 8) Pointers 9) Recursion 10) Extensible
  • 6. First Program of C Language:- #include <stdio.h> #include <conio.h> void main(){ printf("Hello C Language"); getch(); }
  • 7. Describe the C Program:-  #include <stdio.h> includes the standard input output library functions. The printf() function is defined in stdio.h .  #include <conio.h> includes the console input output library functions. The getch() function is defined in conio.h file.  void main() The main() function is the entry point of every program in c language. The void keyword specifies that it returns no value.  printf() The printf() function is used to print data on the console.  getch() The getch() function asks for a single character. Until you press any key, it blocks the screen.
  • 8. Output of Program is:- Hello C Language
  • 9. Input output function:-  There are two input output function of c language. 1) First is printf() 2) Second is scanf()  printf() function is used for output. It prints the given statement to the console.  Syntax of printf() is given below:  printf(“format string”,arguments_list);  Format string can be %d(integer), %c(character), %s(string), %f(float) etc.
  • 10. scanf() Function: is used for input. It reads the input data from console.  scanf(“format string”,argument_list); Note:-See more example of input-output function on:-www.javatpoint.com/printf-scanf
  • 11. Data types in C language:- There are four types of data types in C language. Types Data Types Basic Data Type int, char, float, double Derived Data Type array, pointer, structure, union Enumeration Data Type enum Void Data Type void
  • 12. Keywords in C Language:- A keyword is a reserved word. You cannot use it as a variable name, constant name etc. There are 32 keywords in C language as given below: auto break case char const continu e default do double else enum extern float for goto if int long register return short signed sizeof static struct switch typedef union unsigned void volatile while
  • 13. Operators in C language:-  There are following types of operators to perform different types of operations in C language. 1) Arithmetic Operators 2) Relational Operators 3) Shift Operators 4) Logical Operators 5) Bitwise Operators 6) Ternary or Conditional Operators 7) Assignment Operator 8) Misc Operator
  • 14. Control statement in C language:- 1) if-else 2) switch 3) loops 4) do-while loop 5) while loop 6) for loop 7) break 8) continue
  • 15. C if else statement:- There are many ways to use if statement in C language: 1) If statement 2) If-else statement 3) If else-if ladder 4) Nested if
  • 16. if statement:-  In if statement is used to execute the code if condition is true. syntax:- if(expression){ //code to be execute }
  • 17. If else statement:- The if-else statement is used to execute the code if condition is true or false. Syntax: if(expression){ //code to be executed if condition is true }else{ //code to be executed if condition is false }
  • 18. If else-if ladder Statement:- The if else-if statement is used to execute one code from multiple conditions. Syntax: if(condition1){ //code to be executed if condition1 is true }else if(condition2){ //code to be executed if condition2 is true } else if(condition3){ //code to be executed if condition3 is true } ... else{ //code to be executed if all the conditions are false }
  • 19. if else-if ladder Statement:-  Syntax: if(condition1){ //code to be executed if condition1 is true }else if(condition2){ //code to be executed if condition2 is true } else if(condition3){ //code to be executed if condition3 is true } ... else{ //code to be executed if all the conditions are false }
  • 20. C Switch Statement:-  Syntax: switch(expression){ case value1: //code to be executed; break; //optional case value2: //code to be executed; break; //optional ...... default: code to be executed if all cases are not matched; }
  • 21. Loops in C language:- Loops are used to execute a block of code or a part of program of the program several times. Types of loops in C language:- There are 3 types of loops in c language. 1) do while 2) while 3) for
  • 22. do-while loop in C:-  It is better if you have to execute the code at least once. Syntax:- do{ //code to be executed }while(condition);
  • 23. while loop in c language:-  It is better if number of iteration is not known by the user. Syntax:- while(condition){ //code to be executed }
  • 24. For loop in C language:-  It is good if number of iteration is known by the user. Syntax:- for(initialization;condition;incr/decr){ //code to be executed }
  • 25. C break statement:-  it is used to break the execution of loop (while, do while and for) and switch case. Syntax:- jump-statement; break;
  • 26. Continue statement in C language:-  it is used to continue the execution of loop (while, do while and for). It is used with if condition within the loop. Syntax:- jump-statement; continue; Note:- you can see the example of above all control statements on www.javatpoint.com/c-if else.
  • 27. Functions in C language:- To perform any task, we can create function. A function can be called many times. It provides modularity and code reusability. Advantage of function:- 1) Code Resuability 2) Code optimization
  • 28. Syntax to declare function:- return_type function_name(data_type para meter...){ //code to be executed } Syntax to call function:- variable=function_name(arguments...);
  • 29. Call by value in C language:- In call by value, value being passed to the function is locally stored by the function parameter in stack memory location. If you change the value of function parameter, it is changed for the current function only. It will not change the value of variable inside the caller method such as main().
  • 30. Example of call by value:- #include <stdio.h> #include <conio.h> void change(int num) { printf("Before adding value inside function num=%d n",num); num=num+100; printf("After adding value inside function num=%d n", num); } int main() { int x=100; clrscr(); printf("Before function call x=%d n", x); change(x);//passing value in function printf("After function call x=%d n", x); getch(); return 0; }
  • 31. Output:- Before function call x=100  Before adding value inside function num=100 After adding value inside function num=200 After function call x=100
  • 32. Call by reference in C:-  In call by reference, original value is modified because we pass reference (address).
  • 33. Example of call by Reference:- #include <stdio.h> #include <conio.h> void change(int *num) { printf("Before adding value inside function num=%d n",*num); (*num) += 100; printf("After adding value inside function num=%d n", *num); } int main() { int x=100; clrscr(); printf("Before function call x=%d n", x); change(&x);//passing reference in function printf("After function call x=%d n", x); getch(); return 0; }
  • 34. Output:- Before function call x=100 Before adding value inside function num=100 After adding value inside function num=200 After function call x=200
  • 35. Recursion in C:-  A function that calls itself, and doen't perform any task after function call, is know as tail recursion. In tail recursion, we generally call the same function with return statement. Syntax:- recursionfunction(){ recursionfunction();//calling self function }
  • 36. Array in C:-  Array in C language is a collection or group of elements (data). All the elements of array are homogeneous(similar). It has contiguous memory location. Declaration of array:-  data_type array_name[array_size]; Eg:-  int marks[7]; Types of array:- 1) 1-D Array 2) 2-D Array
  • 37. Advantage of array:- 1) Code Optimization 2) Easy to traverse data 3) Easy to sort data 4) Random Access
  • 38. 2-D Array in C:- 2-d Array is represented in the form of rows and columns, also known as matrix. It is also known as array of arrays or list of arrays. Declaration of 2-d array:- data_type array_name[size1][size2];
  • 39. Initialization of 2-d array:- int arr[3][4]={{1,2,3,4},{2,3,4,5},{3,4, 5,6}};