SlideShare une entreprise Scribd logo
1  sur  29
Disclaimer: This presentation is prepared by trainees of
baabtra as a part of mentoring program. This is not
official document of baabtra –Mentoring Partner
Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt .
Ltd
Basics of C Program
Niyaz Kannanchery
niyazofficial@gmail.com
tweetboy
niyazsky
9746 049 048
in/niyazsky
Info about C
C is a general-purpose high level language that was originally developed by Dennis
Ritchie for the Unix operating system. It was first implemented on the Digital
Equipment Corporation PDP-11 computer in 1972.
The Unix operating system and virtually all Unix applications are written in the C
language. C has now become a widely used professional language for various
reasons.
• Easy to learn
• Structured language
• It produces efficient programs.
• It can handle low-level activities.
• It can be compiled on a variety of computers
Facts about C Language
• C was invented to write an operating system called UNIX.
• C is a successor of B language which was introduced around 1970
• The language was formalized in 1988 by the American National Standard Institue
(ANSI).
• By 1973 UNIX OS almost totally written in C.
• Today C is the most widely used System Programming Language.
• Most of the state of the art software have been implemented using C
Note the followings
 C is a case sensitive programming language. It means in C printf and Printf will have
different meanings.
 C has a free-form line structure. End of each C statement must be marked with a
semicolon.
 Multiple statements can be one the same line.
 White Spaces (ie tab space and space bar ) are ignored.
 Statements can continue over multiple lines.
KeyWords Constants Strings
Identifers Special Symbols
Operators
In a C source program, the basic element recognized by the
compiler is the "token." A token is source-program text that the
compiler does not break down into component elements.
Sample C Program Code
#include<stdio.h>
void main()
{
int A,B,C;
printf("Enter the two numbern");
scanf("%d %d",&A,&B);
C=A+B;
printf("%dn",C);
}
Keywords are the base building block of any Computer Language.
Keywords tells to the compiler of the Language what Programmer meant.
auto double int struct
break else long switch
case enum register typedef
char extern return union
const float short unsigned
continue for signed void
default goto sizeof volatile
do if static while
Identifiers
The name of Variable,Functions,Labels and various other user defined items are Called identifier.
The length of these identifier can vary from one to several character.
Rules for Identifiers
 First character must be in alphabet or underscore.
 Must consist of only letters, digits or underscore.
 Only first 31 character are significant.
 Cannot use a Keyword.
 Must not contain white Space
Constants
Its an Variable that says the same once declared and cannot be change at run time.
String
A string is a Sequence of Character enclosed in double quotes.
Operators
An Operators is a symbol that tells the computer to Perform certain mathematical or
Logical operations.
Special Symbols
Space + - * / ^  () [] {} = != <> ‘ “ $ , ; : % ! & ? _ # <= >= @
DATA TYPES in C Language
C has a concept of 'data types' which are used to define a variable
before its use. The definition of a variable will assign storage for
the variable and define the type of data that will be held in the
location. The value of a variable can be changed any time.
C has the following basic built-in datatypes
 int
 float
 double
 char
Format Specifiers
Format Specifiers
There are many format specifiers defined in C. Take a look at the following list
Format Specifiers Using for
%i or %d int
%c Char
%f Float
%lf Double
%s String
Sample C Program Code
#include<stdio.h>
void main()
{
int A,B,C;
printf("Enter the two numbern");
scanf("%d %d",&A,&B);
C=A+B;
printf("%dn",C);
}
Understanding the Execution
Decision Making Statements
Statement Description
if statement An if statement consists of a boolean expression
followed by one or more statements.
if...else statement An if statement can be followed by an optional else
statement, which executes when the boolean
expression is false.
nested if statements You can use one if or else if statement inside
another if or else if statement(s).
switch statement A switch statement allows a variable to be tested for
equality against a list of values.
nested switch statements You can use one swicth statement inside
another switchstatement(s).
Problem Statement
If Statement
Enter a number & Check whether its Less than 100?
If Statement
#include <stdio.h>
int main ()
{
/* local variable definition */
int a = 10;
/* check the boolean condition using if statement
*/
if( a < 20 )
{
/* if condition is true then print the following */
printf("a is less than 20n" );
}
printf("value of a is : %dn", a);
return 0;
}
Problem Statement
If Else Statement
Find a Person can do Vote in Election? based on Age.
If else statement
#include <stdio.h>
int main ()
{
/* local variable definition */
int a = 100;
/* check the boolean condition */
if( a < 20 )
{
/* if condition is true then print the following */
printf("a is less than 20n" );
}
else
{
/* if condition is false then print the following */
printf("a is not less than 20n" );
}
printf("value of a is : %dn", a);
return 0;
}
Problem Statement
Switch Statement
Selecting new language in Mobile?
Switch Statement
#include <stdio.h>
int main ()
{
/* local variable definition */
char grade = 'B';
switch(grade)
{
case 'A' :
printf("Excellent!n" );
break;
case 'B' :
printf("Well donen" );
break;
case 'D' :
printf("You passedn" );
break;
case 'F' :
printf("Better try againn" );
break;
default :
printf("Invalid graden" );
}
printf("Your grade is %cn", grade );
return 0;
}
Loops
Loop Type Description
while loop Repeats a statement or group of statements until a given
condition is true. It tests the condition before executing the
loop body.( First Check the Condition, If its true enter the
Loop)
for loop Execute a sequence of statements multiple times and
abbreviates the code that manages the loop variable
(initialization, Condition, Increment or decrement)
do...while loop Like a while statement, except that it tests the condition at
the end of the loop body. (Whatever the condition it
execute at least once)
nested loops You can use one or more loop inside any another while, for
or do..while loop (inside another loop)
Problem Statement
For Loop
Enter and Display Student is Elite or Normal? Based on Fee
For Loop
#include <stdio.h>
int main ()
{
/* for loop execution */
for( int a = 10; a < 20; a = a + 1 )
{
printf("value of a: %dn", a);
}
return 0;
}
While Loop
#include <stdio.h>
int main ()
{
/* local variable definition */
int a = 10;
/* while loop execution */
while( a < 20 )
{
printf("value of a: %dn", a);
a++;
}
return 0;
}
Array
An array is data structure (type of memory layout) that stores a collection
of individual values that are of the same data type.
Problem Statement
Array
Enter Roll No and Mark of Students and Display it?
(0) 10001 56 (1)
(1) 10002 46 (2)
(2) 10003 67 (3)
(3) 10004 47 (4)
Click for Program
QUESTIONS SECTION
If this presentation helped you, please visit our
page facebook.com/baabtra and like it.
Thanks in advance.
www.baabtra.com | www.massbaab.com |www.baabte.com

Contenu connexe

Tendances

Introduction to Basic C programming 01
Introduction to Basic C programming 01Introduction to Basic C programming 01
Introduction to Basic C programming 01Wingston
 
Structure of c_program_to_input_output
Structure of c_program_to_input_outputStructure of c_program_to_input_output
Structure of c_program_to_input_outputAnil Dutt
 
Programming in C Presentation upto FILE
Programming in C Presentation upto FILEProgramming in C Presentation upto FILE
Programming in C Presentation upto FILEDipta Saha
 
C Language (All Concept)
C Language (All Concept)C Language (All Concept)
C Language (All Concept)sachindane
 
'C' language notes (a.p)
'C' language notes (a.p)'C' language notes (a.p)
'C' language notes (a.p)Ashishchinu
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programmingRutvik Pensionwar
 
Complete C programming Language Course
Complete C programming Language CourseComplete C programming Language Course
Complete C programming Language CourseVivek chan
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C ProgrammingAniket Patne
 
Fundamental of C Programming Language and Basic Input/Output Function
  Fundamental of C Programming Language and Basic Input/Output Function  Fundamental of C Programming Language and Basic Input/Output Function
Fundamental of C Programming Language and Basic Input/Output Functionimtiazalijoono
 
pointer, structure ,union and intro to file handling
pointer, structure ,union and intro to file handlingpointer, structure ,union and intro to file handling
pointer, structure ,union and intro to file handlingRai University
 
What is keyword in c programming
What is keyword in c programmingWhat is keyword in c programming
What is keyword in c programmingRumman Ansari
 

Tendances (20)

C notes.pdf
C notes.pdfC notes.pdf
C notes.pdf
 
The smartpath information systems c pro
The smartpath information systems c proThe smartpath information systems c pro
The smartpath information systems c pro
 
Introduction to Basic C programming 01
Introduction to Basic C programming 01Introduction to Basic C programming 01
Introduction to Basic C programming 01
 
Structure of c_program_to_input_output
Structure of c_program_to_input_outputStructure of c_program_to_input_output
Structure of c_program_to_input_output
 
C language basics
C language basicsC language basics
C language basics
 
Programming in C Presentation upto FILE
Programming in C Presentation upto FILEProgramming in C Presentation upto FILE
Programming in C Presentation upto FILE
 
C tutorial
C tutorialC tutorial
C tutorial
 
C Language (All Concept)
C Language (All Concept)C Language (All Concept)
C Language (All Concept)
 
CProgrammingTutorial
CProgrammingTutorialCProgrammingTutorial
CProgrammingTutorial
 
'C' language notes (a.p)
'C' language notes (a.p)'C' language notes (a.p)
'C' language notes (a.p)
 
Python Programming
Python ProgrammingPython Programming
Python Programming
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
 
Structure of a C program
Structure of a C programStructure of a C program
Structure of a C program
 
Complete C programming Language Course
Complete C programming Language CourseComplete C programming Language Course
Complete C programming Language Course
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
Fundamental of C Programming Language and Basic Input/Output Function
  Fundamental of C Programming Language and Basic Input/Output Function  Fundamental of C Programming Language and Basic Input/Output Function
Fundamental of C Programming Language and Basic Input/Output Function
 
pointer, structure ,union and intro to file handling
pointer, structure ,union and intro to file handlingpointer, structure ,union and intro to file handling
pointer, structure ,union and intro to file handling
 
C language
C languageC language
C language
 
C fundamental
C fundamentalC fundamental
C fundamental
 
What is keyword in c programming
What is keyword in c programmingWhat is keyword in c programming
What is keyword in c programming
 

En vedette

En vedette (19)

Class
ClassClass
Class
 
Project management difference between industry and college
Project management difference between industry and collegeProject management difference between industry and college
Project management difference between industry and college
 
Datatypes
DatatypesDatatypes
Datatypes
 
Xml
XmlXml
Xml
 
Complex number
Complex numberComplex number
Complex number
 
Exception handling
Exception handlingException handling
Exception handling
 
Algorithms&flowcharts
Algorithms&flowchartsAlgorithms&flowcharts
Algorithms&flowcharts
 
Cms
CmsCms
Cms
 
Exception Handling
Exception HandlingException Handling
Exception Handling
 
It careers
It careersIt careers
It careers
 
Fb career profile
Fb career profileFb career profile
Fb career profile
 
Stack and Heap
Stack and HeapStack and Heap
Stack and Heap
 
Improve typing speed
Improve typing speedImprove typing speed
Improve typing speed
 
RDBMS
RDBMSRDBMS
RDBMS
 
Inheritance
InheritanceInheritance
Inheritance
 
Android adapters
Android adaptersAndroid adapters
Android adapters
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
baabtra, First Programming School in India SRS, stock management system
baabtra, First Programming School in India SRS, stock management systembaabtra, First Programming School in India SRS, stock management system
baabtra, First Programming School in India SRS, stock management system
 
Crystal report
Crystal reportCrystal report
Crystal report
 

Similaire à Basics of C porgramming

Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programmingAlpana Gupta
 
C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)indrasir
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C ProgrammingMOHAMAD NOH AHMAD
 
Chapter3
Chapter3Chapter3
Chapter3Kamran
 
C LANGUAGE UNIT-1 PREPARED BY MVB REDDY
C LANGUAGE UNIT-1 PREPARED BY MVB REDDYC LANGUAGE UNIT-1 PREPARED BY MVB REDDY
C LANGUAGE UNIT-1 PREPARED BY MVB REDDYRajeshkumar Reddy
 
C++ programming language basic to advance level
C++ programming language basic to advance levelC++ programming language basic to advance level
C++ programming language basic to advance levelsajjad ali khan
 
Programming in C - interview questions.pdf
Programming in C - interview questions.pdfProgramming in C - interview questions.pdf
Programming in C - interview questions.pdfSergiuMatei7
 
2.Overview of C language.pptx
2.Overview of C language.pptx2.Overview of C language.pptx
2.Overview of C language.pptxVishwas459764
 
(Lect. 2 & 3) Introduction to C.ppt
(Lect. 2 & 3) Introduction to C.ppt(Lect. 2 & 3) Introduction to C.ppt
(Lect. 2 & 3) Introduction to C.pptatulchaudhary821
 
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...RSathyaPriyaCSEKIOT
 
Datastructure notes
Datastructure notesDatastructure notes
Datastructure notesSrikanth
 

Similaire à Basics of C porgramming (20)

Basic c
Basic cBasic c
Basic c
 
C programming
C programmingC programming
C programming
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
C programming
C programmingC programming
C programming
 
C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)
 
Programming in C
Programming in CProgramming in C
Programming in C
 
C programming
C programmingC programming
C programming
 
fds unit1.docx
fds unit1.docxfds unit1.docx
fds unit1.docx
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
Chapter3
Chapter3Chapter3
Chapter3
 
C LANGUAGE UNIT-1 PREPARED BY MVB REDDY
C LANGUAGE UNIT-1 PREPARED BY MVB REDDYC LANGUAGE UNIT-1 PREPARED BY MVB REDDY
C LANGUAGE UNIT-1 PREPARED BY MVB REDDY
 
C++ programming language basic to advance level
C++ programming language basic to advance levelC++ programming language basic to advance level
C++ programming language basic to advance level
 
Programming in C - interview questions.pdf
Programming in C - interview questions.pdfProgramming in C - interview questions.pdf
Programming in C - interview questions.pdf
 
2.Overview of C language.pptx
2.Overview of C language.pptx2.Overview of C language.pptx
2.Overview of C language.pptx
 
C fundamentals
C fundamentalsC fundamentals
C fundamentals
 
(Lect. 2 & 3) Introduction to C.ppt
(Lect. 2 & 3) Introduction to C.ppt(Lect. 2 & 3) Introduction to C.ppt
(Lect. 2 & 3) Introduction to C.ppt
 
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
 
Introduction%20C.pptx
Introduction%20C.pptxIntroduction%20C.pptx
Introduction%20C.pptx
 
C programming
C programmingC programming
C programming
 
Datastructure notes
Datastructure notesDatastructure notes
Datastructure notes
 

Plus de baabtra.com - No. 1 supplier of quality freshers

Plus de baabtra.com - No. 1 supplier of quality freshers (20)

Agile methodology and scrum development
Agile methodology and scrum developmentAgile methodology and scrum development
Agile methodology and scrum development
 
Best coding practices
Best coding practicesBest coding practices
Best coding practices
 
Core java - baabtra
Core java - baabtraCore java - baabtra
Core java - baabtra
 
Acquiring new skills what you should know
Acquiring new skills   what you should knowAcquiring new skills   what you should know
Acquiring new skills what you should know
 
Baabtra.com programming at school
Baabtra.com programming at schoolBaabtra.com programming at school
Baabtra.com programming at school
 
99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love 99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love
 
Php sessions & cookies
Php sessions & cookiesPhp sessions & cookies
Php sessions & cookies
 
Php database connectivity
Php database connectivityPhp database connectivity
Php database connectivity
 
Chapter 6 database normalisation
Chapter 6  database normalisationChapter 6  database normalisation
Chapter 6 database normalisation
 
Chapter 5 transactions and dcl statements
Chapter 5  transactions and dcl statementsChapter 5  transactions and dcl statements
Chapter 5 transactions and dcl statements
 
Chapter 4 functions, views, indexing
Chapter 4  functions, views, indexingChapter 4  functions, views, indexing
Chapter 4 functions, views, indexing
 
Chapter 3 stored procedures
Chapter 3 stored proceduresChapter 3 stored procedures
Chapter 3 stored procedures
 
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 2  grouping,scalar and aggergate functions,joins   inner join,outer joinChapter 2  grouping,scalar and aggergate functions,joins   inner join,outer join
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Microsoft holo lens
Microsoft holo lensMicrosoft holo lens
Microsoft holo lens
 
Blue brain
Blue brainBlue brain
Blue brain
 
5g
5g5g
5g
 
Aptitude skills baabtra
Aptitude skills baabtraAptitude skills baabtra
Aptitude skills baabtra
 
Gd baabtra
Gd baabtraGd baabtra
Gd baabtra
 

Dernier

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Dernier (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

Basics of C porgramming

  • 1.
  • 2. Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring Partner Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
  • 3. Basics of C Program Niyaz Kannanchery niyazofficial@gmail.com tweetboy niyazsky 9746 049 048 in/niyazsky
  • 4. Info about C C is a general-purpose high level language that was originally developed by Dennis Ritchie for the Unix operating system. It was first implemented on the Digital Equipment Corporation PDP-11 computer in 1972. The Unix operating system and virtually all Unix applications are written in the C language. C has now become a widely used professional language for various reasons. • Easy to learn • Structured language • It produces efficient programs. • It can handle low-level activities. • It can be compiled on a variety of computers
  • 5. Facts about C Language • C was invented to write an operating system called UNIX. • C is a successor of B language which was introduced around 1970 • The language was formalized in 1988 by the American National Standard Institue (ANSI). • By 1973 UNIX OS almost totally written in C. • Today C is the most widely used System Programming Language. • Most of the state of the art software have been implemented using C Note the followings  C is a case sensitive programming language. It means in C printf and Printf will have different meanings.  C has a free-form line structure. End of each C statement must be marked with a semicolon.  Multiple statements can be one the same line.  White Spaces (ie tab space and space bar ) are ignored.  Statements can continue over multiple lines.
  • 6. KeyWords Constants Strings Identifers Special Symbols Operators In a C source program, the basic element recognized by the compiler is the "token." A token is source-program text that the compiler does not break down into component elements.
  • 7. Sample C Program Code #include<stdio.h> void main() { int A,B,C; printf("Enter the two numbern"); scanf("%d %d",&A,&B); C=A+B; printf("%dn",C); }
  • 8. Keywords are the base building block of any Computer Language. Keywords tells to the compiler of the Language what Programmer meant. auto double int struct break else long switch case enum register typedef char extern return union const float short unsigned continue for signed void default goto sizeof volatile do if static while
  • 9. Identifiers The name of Variable,Functions,Labels and various other user defined items are Called identifier. The length of these identifier can vary from one to several character. Rules for Identifiers  First character must be in alphabet or underscore.  Must consist of only letters, digits or underscore.  Only first 31 character are significant.  Cannot use a Keyword.  Must not contain white Space
  • 10. Constants Its an Variable that says the same once declared and cannot be change at run time. String A string is a Sequence of Character enclosed in double quotes. Operators An Operators is a symbol that tells the computer to Perform certain mathematical or Logical operations. Special Symbols Space + - * / ^ () [] {} = != <> ‘ “ $ , ; : % ! & ? _ # <= >= @
  • 11. DATA TYPES in C Language C has a concept of 'data types' which are used to define a variable before its use. The definition of a variable will assign storage for the variable and define the type of data that will be held in the location. The value of a variable can be changed any time. C has the following basic built-in datatypes  int  float  double  char
  • 12. Format Specifiers Format Specifiers There are many format specifiers defined in C. Take a look at the following list Format Specifiers Using for %i or %d int %c Char %f Float %lf Double %s String
  • 13. Sample C Program Code #include<stdio.h> void main() { int A,B,C; printf("Enter the two numbern"); scanf("%d %d",&A,&B); C=A+B; printf("%dn",C); }
  • 15. Decision Making Statements Statement Description if statement An if statement consists of a boolean expression followed by one or more statements. if...else statement An if statement can be followed by an optional else statement, which executes when the boolean expression is false. nested if statements You can use one if or else if statement inside another if or else if statement(s). switch statement A switch statement allows a variable to be tested for equality against a list of values. nested switch statements You can use one swicth statement inside another switchstatement(s).
  • 16. Problem Statement If Statement Enter a number & Check whether its Less than 100?
  • 17. If Statement #include <stdio.h> int main () { /* local variable definition */ int a = 10; /* check the boolean condition using if statement */ if( a < 20 ) { /* if condition is true then print the following */ printf("a is less than 20n" ); } printf("value of a is : %dn", a); return 0; }
  • 18. Problem Statement If Else Statement Find a Person can do Vote in Election? based on Age.
  • 19. If else statement #include <stdio.h> int main () { /* local variable definition */ int a = 100; /* check the boolean condition */ if( a < 20 ) { /* if condition is true then print the following */ printf("a is less than 20n" ); } else { /* if condition is false then print the following */ printf("a is not less than 20n" ); } printf("value of a is : %dn", a); return 0; }
  • 21. Switch Statement #include <stdio.h> int main () { /* local variable definition */ char grade = 'B'; switch(grade) { case 'A' : printf("Excellent!n" ); break; case 'B' : printf("Well donen" ); break; case 'D' : printf("You passedn" ); break; case 'F' : printf("Better try againn" ); break; default : printf("Invalid graden" ); } printf("Your grade is %cn", grade ); return 0; }
  • 22. Loops Loop Type Description while loop Repeats a statement or group of statements until a given condition is true. It tests the condition before executing the loop body.( First Check the Condition, If its true enter the Loop) for loop Execute a sequence of statements multiple times and abbreviates the code that manages the loop variable (initialization, Condition, Increment or decrement) do...while loop Like a while statement, except that it tests the condition at the end of the loop body. (Whatever the condition it execute at least once) nested loops You can use one or more loop inside any another while, for or do..while loop (inside another loop)
  • 23. Problem Statement For Loop Enter and Display Student is Elite or Normal? Based on Fee
  • 24. For Loop #include <stdio.h> int main () { /* for loop execution */ for( int a = 10; a < 20; a = a + 1 ) { printf("value of a: %dn", a); } return 0; }
  • 25. While Loop #include <stdio.h> int main () { /* local variable definition */ int a = 10; /* while loop execution */ while( a < 20 ) { printf("value of a: %dn", a); a++; } return 0; }
  • 26. Array An array is data structure (type of memory layout) that stores a collection of individual values that are of the same data type.
  • 27. Problem Statement Array Enter Roll No and Mark of Students and Display it? (0) 10001 56 (1) (1) 10002 46 (2) (2) 10003 67 (3) (3) 10004 47 (4) Click for Program
  • 29. If this presentation helped you, please visit our page facebook.com/baabtra and like it. Thanks in advance. www.baabtra.com | www.massbaab.com |www.baabte.com