SlideShare una empresa de Scribd logo
1 de 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

Más contenido relacionado

La actualidad más candente

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
 

La actualidad más candente (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
 

Destacado

Destacado (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
 

Similar a 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
 

Similar a 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
 

Más de baabtra.com - No. 1 supplier of quality freshers

Más 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
 

Último

Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 

Último (20)

Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 

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