SlideShare a Scribd company logo
1 of 3
Basic rules to begin:
1. In separate statement each instruction should be written. Therefore , complete C program consist of
set of instructions.
2. The statements in program must be written in sequencial order to get desired output.Unless any
logic problem can be arise.
3. All statement should written in small case letters.
4. C has no particular rules for position at which statement is to be typed.
5. In C program every statement must end with ; (semicolon).It act as a terminator.
Rules for Comment:
 Comment in the program should be enclosed within /* .. */ .Look example below the first line is
comment.
For ex. /*This my first program*/
#include<stdio.h>
main()
{
Statement;
Statement;
}
 Though comments are not necessary,but it good practice to begin program with comment
indicating purpose of program so that other person can get idea of program.
 You can write any number comment at any place in program mentioning the purpose of the
statement.
 Use few Comment instead of too many.
 A comment cannot be nested. For ex., /* The/* first/*program*/*/*/.
 A comment can split over more than one line. For ex.
/*THE
First
Program*/
Main method:
 main() is a collection of the set of statements. Statements are always enclosed belongs to main()
within pairs of {} (opening and closing braces).For ex.
void main()
{
1st statement;
2nd statement;
}
 Technically main() is a function because every function has the pair of parentheses ( ) associated
with it.
 The function in c have their return type, Similarly, If we want that main() function should not return
any value of particular type precede it with void ,int etc.
Declaration:
 Any variable used in the program must be declared before using it. For ex,
int a,b,c; /*declaration*/
float a,b,c; /*declaration*/
a=a+b; /*usage*/
 For declaration see the datatype table as follow:
Datatype number Declaration format string
Integer 1,+5,-5 int a; "%d", a
Float 11.363,+1.14,-12.11 float a; "%f", a
Double +1.123123,-1.234345 double a; "%l", a
Character 'A','B' char a; "%c",a
String "Dev.com" char a[20]; "%c",a
 Ways of declaration in C lets see:
a) While declaration you can also initialize it as
int a=1,b=24; , float a=1.5, b=1.98+3.8*2.7;
b) The order sometimes matter in initialization.For ex.
int i = 1, j=24; is same as int j=24,j=1;
float a=1.8 , b= 3.1+a; is alright but float b =3.1+a ,a=1.8; is not this why we
have to initialize a
before.
c) Lets another statements:
int x,y,z;
x=y=z=10; work perfectly
int x=y=z=10; not work because once again we are trying to use y
(assign to y) before
defining it.
Statement:
 For ex,
float p,n, r,si;
scanf("%f", &si);
si= p*n*r/100;
printf("%f", si);
printf("problem done n");
 you can notice *, / are arithmetic operator in C. C is very rich in operator hence there about 45
operator available in C.
 For input use scanf("%d,%f",&a,&c); function i.e syntaxis scanf("<format string1>,<format
string2>,...",&variable1 ,&variable2..);
 For output use printf("%d,%f",&a,&c); function i.e syntaxis printf("<format string1>,<format
string2>",variable1,variable2); , & is used in scanf function is must because it is "Address of
operator".It gives the location number used by variable.
 printf() function can print values of variable as well as print the result of an expression:for ex
printf("%d,%d,%d,%d",3,3+2,c,a+b*c-d);.
 Format specifier or format string are like %f, %d, %c, %l used for input and output.
 n in the statement is for print output in next line.
Linking:
 To use printf() function it is necessary to use #include<stdio.h> at beginning of program.#include is
the preprocessor directive.
 #include<stdio.h> stands for standard input output,#include<conio.h> stands for control input
output.These are most commonly used for Linking.

More Related Content

What's hot

1584503386 1st chap
1584503386 1st chap1584503386 1st chap
1584503386 1st chapthuhiendtk4
 
Basic of c programming www.eakanchha.com
Basic of c programming www.eakanchha.comBasic of c programming www.eakanchha.com
Basic of c programming www.eakanchha.comAkanchha Agrawal
 
C lecture 3 control statements slideshare
C lecture 3 control statements slideshareC lecture 3 control statements slideshare
C lecture 3 control statements slideshareGagan Deep
 
Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7alish sha
 
Dti2143 lab sheet 6
Dti2143 lab sheet 6Dti2143 lab sheet 6
Dti2143 lab sheet 6alish sha
 
Infix-Postfix expression conversion
Infix-Postfix expression conversionInfix-Postfix expression conversion
Infix-Postfix expression conversionRashmiranja625
 
C programming(Part 1)
C programming(Part 1)C programming(Part 1)
C programming(Part 1)SURBHI SAROHA
 
COM1407: Program Control Structures – Decision Making & Branching
COM1407: Program Control Structures – Decision Making & BranchingCOM1407: Program Control Structures – Decision Making & Branching
COM1407: Program Control Structures – Decision Making & BranchingHemantha Kulathilake
 
Operators and expressions in c language
Operators and expressions in c languageOperators and expressions in c language
Operators and expressions in c languagetanmaymodi4
 
C programming Lab 1
C programming Lab 1C programming Lab 1
C programming Lab 1Zaibi Gondal
 
Programming fundamentals
Programming fundamentalsProgramming fundamentals
Programming fundamentalsZaibi Gondal
 
Decision statements in c language
Decision statements in c languageDecision statements in c language
Decision statements in c languagetanmaymodi4
 

What's hot (19)

Operators
OperatorsOperators
Operators
 
1584503386 1st chap
1584503386 1st chap1584503386 1st chap
1584503386 1st chap
 
Basic of c programming www.eakanchha.com
Basic of c programming www.eakanchha.comBasic of c programming www.eakanchha.com
Basic of c programming www.eakanchha.com
 
Ch3 selection
Ch3 selectionCh3 selection
Ch3 selection
 
C lecture 3 control statements slideshare
C lecture 3 control statements slideshareC lecture 3 control statements slideshare
C lecture 3 control statements slideshare
 
Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7
 
Dti2143 lab sheet 6
Dti2143 lab sheet 6Dti2143 lab sheet 6
Dti2143 lab sheet 6
 
Lab 1
Lab 1Lab 1
Lab 1
 
Infix-Postfix expression conversion
Infix-Postfix expression conversionInfix-Postfix expression conversion
Infix-Postfix expression conversion
 
C programming(Part 1)
C programming(Part 1)C programming(Part 1)
C programming(Part 1)
 
COM1407: Program Control Structures – Decision Making & Branching
COM1407: Program Control Structures – Decision Making & BranchingCOM1407: Program Control Structures – Decision Making & Branching
COM1407: Program Control Structures – Decision Making & Branching
 
Mycasestudy
MycasestudyMycasestudy
Mycasestudy
 
Operators and expressions in c language
Operators and expressions in c languageOperators and expressions in c language
Operators and expressions in c language
 
C programming Lab 1
C programming Lab 1C programming Lab 1
C programming Lab 1
 
Cinfo
CinfoCinfo
Cinfo
 
Programming fundamentals
Programming fundamentalsProgramming fundamentals
Programming fundamentals
 
Decision statements in c language
Decision statements in c languageDecision statements in c language
Decision statements in c language
 
First c program
First c programFirst c program
First c program
 
Assignment7
Assignment7Assignment7
Assignment7
 

Viewers also liked

ESTRATEGIAS DE NEGOCIACION2 benjamin marco Univ. Nacional mexico
ESTRATEGIAS DE NEGOCIACION2 benjamin marco Univ. Nacional mexico ESTRATEGIAS DE NEGOCIACION2 benjamin marco Univ. Nacional mexico
ESTRATEGIAS DE NEGOCIACION2 benjamin marco Univ. Nacional mexico Benjamín Marco
 
1 sample16c55 individual-attributes-of-a-person
1 sample16c55 individual-attributes-of-a-person1 sample16c55 individual-attributes-of-a-person
1 sample16c55 individual-attributes-of-a-personMary Jones
 
Why should we donate blood
Why should we donate bloodWhy should we donate blood
Why should we donate bloodsykat roy
 
企業傳承班 行銷策略與消費者心理學-個案-法蝶倒閉-詹翔霖教授
企業傳承班 行銷策略與消費者心理學-個案-法蝶倒閉-詹翔霖教授企業傳承班 行銷策略與消費者心理學-個案-法蝶倒閉-詹翔霖教授
企業傳承班 行銷策略與消費者心理學-個案-法蝶倒閉-詹翔霖教授文化大學
 
Assess quality level of the final product by using Demerit system: A case stu...
Assess quality level of the final product by using Demerit system: A case stu...Assess quality level of the final product by using Demerit system: A case stu...
Assess quality level of the final product by using Demerit system: A case stu...researchinventy
 

Viewers also liked (13)

ESTRATEGIAS DE NEGOCIACION2 benjamin marco Univ. Nacional mexico
ESTRATEGIAS DE NEGOCIACION2 benjamin marco Univ. Nacional mexico ESTRATEGIAS DE NEGOCIACION2 benjamin marco Univ. Nacional mexico
ESTRATEGIAS DE NEGOCIACION2 benjamin marco Univ. Nacional mexico
 
Resume_Bindhu (2)
Resume_Bindhu (2)Resume_Bindhu (2)
Resume_Bindhu (2)
 
Pepe Mujica
Pepe MujicaPepe Mujica
Pepe Mujica
 
1 sample16c55 individual-attributes-of-a-person
1 sample16c55 individual-attributes-of-a-person1 sample16c55 individual-attributes-of-a-person
1 sample16c55 individual-attributes-of-a-person
 
Digital wallet
Digital walletDigital wallet
Digital wallet
 
oligopoly
oligopolyoligopoly
oligopoly
 
Why should we donate blood
Why should we donate bloodWhy should we donate blood
Why should we donate blood
 
企業傳承班 行銷策略與消費者心理學-個案-法蝶倒閉-詹翔霖教授
企業傳承班 行銷策略與消費者心理學-個案-法蝶倒閉-詹翔霖教授企業傳承班 行銷策略與消費者心理學-個案-法蝶倒閉-詹翔霖教授
企業傳承班 行銷策略與消費者心理學-個案-法蝶倒閉-詹翔霖教授
 
Assess quality level of the final product by using Demerit system: A case stu...
Assess quality level of the final product by using Demerit system: A case stu...Assess quality level of the final product by using Demerit system: A case stu...
Assess quality level of the final product by using Demerit system: A case stu...
 
Atos ecarga brochure_ sk
Atos ecarga brochure_ skAtos ecarga brochure_ sk
Atos ecarga brochure_ sk
 
Top Holiday Weekend campaigns of 2016
Top Holiday Weekend campaigns of 2016Top Holiday Weekend campaigns of 2016
Top Holiday Weekend campaigns of 2016
 
George Michael
George MichaelGeorge Michael
George Michael
 
Transposicion didaíctica
Transposicion didaícticaTransposicion didaíctica
Transposicion didaíctica
 

Similar to Basic C Programming Rules

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
 
Presentation 2 (1).pdf
Presentation 2 (1).pdfPresentation 2 (1).pdf
Presentation 2 (1).pdfziyadaslanbey
 
Introduction to programming c and data-structures
Introduction to programming c and data-structures Introduction to programming c and data-structures
Introduction to programming c and data-structures Pradipta Mishra
 
1. Problem StatementWrite a C Program - using if else statements,
1. Problem StatementWrite a C Program - using if else statements, 1. Problem StatementWrite a C Program - using if else statements,
1. Problem StatementWrite a C Program - using if else statements, TatianaMajor22
 
Introduction to programming c and data structures
Introduction to programming c and data structuresIntroduction to programming c and data structures
Introduction to programming c and data structuresPradipta Mishra
 
Ch2 introduction to c
Ch2 introduction to cCh2 introduction to c
Ch2 introduction to cHattori Sidek
 
Overview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya JyothiOverview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya JyothiSowmya Jyothi
 
Programming Fundamentals lecture 5
Programming Fundamentals lecture 5Programming Fundamentals lecture 5
Programming Fundamentals lecture 5REHAN IJAZ
 
Chapter 1_C Fundamentals_HS_Tech Yourself C.pptx
Chapter 1_C Fundamentals_HS_Tech Yourself C.pptxChapter 1_C Fundamentals_HS_Tech Yourself C.pptx
Chapter 1_C Fundamentals_HS_Tech Yourself C.pptxssuser71a90c
 
Complete C programming Language Course
Complete C programming Language CourseComplete C programming Language Course
Complete C programming Language CourseVivek chan
 
Fundamentals of computer programming by Dr. A. Charan Kumari
Fundamentals of computer programming by Dr. A. Charan KumariFundamentals of computer programming by Dr. A. Charan Kumari
Fundamentals of computer programming by Dr. A. Charan KumariTHE NORTHCAP UNIVERSITY
 

Similar to Basic C Programming Rules (20)

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...
 
Presentation 2 (1).pdf
Presentation 2 (1).pdfPresentation 2 (1).pdf
Presentation 2 (1).pdf
 
Programming in C
Programming in CProgramming in C
Programming in C
 
Introduction to programming c and data-structures
Introduction to programming c and data-structures Introduction to programming c and data-structures
Introduction to programming c and data-structures
 
C programming
C programmingC programming
C programming
 
1. Problem StatementWrite a C Program - using if else statements,
1. Problem StatementWrite a C Program - using if else statements, 1. Problem StatementWrite a C Program - using if else statements,
1. Problem StatementWrite a C Program - using if else statements,
 
Introduction to programming c and data structures
Introduction to programming c and data structuresIntroduction to programming c and data structures
Introduction to programming c and data structures
 
C programming
C programmingC programming
C programming
 
What is c
What is cWhat is c
What is c
 
C language updated
C language updatedC language updated
C language updated
 
Ch2 introduction to c
Ch2 introduction to cCh2 introduction to c
Ch2 introduction to c
 
88 c-programs
88 c-programs88 c-programs
88 c-programs
 
Overview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya JyothiOverview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya Jyothi
 
Programming Fundamentals lecture 5
Programming Fundamentals lecture 5Programming Fundamentals lecture 5
Programming Fundamentals lecture 5
 
Chapter 1_C Fundamentals_HS_Tech Yourself C.pptx
Chapter 1_C Fundamentals_HS_Tech Yourself C.pptxChapter 1_C Fundamentals_HS_Tech Yourself C.pptx
Chapter 1_C Fundamentals_HS_Tech Yourself C.pptx
 
C programming
C programmingC programming
C programming
 
Complete C programming Language Course
Complete C programming Language CourseComplete C programming Language Course
Complete C programming Language Course
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Fundamentals of computer programming by Dr. A. Charan Kumari
Fundamentals of computer programming by Dr. A. Charan KumariFundamentals of computer programming by Dr. A. Charan Kumari
Fundamentals of computer programming by Dr. A. Charan Kumari
 
C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
 

Recently uploaded

Akola Call Girls #9907093804 Contact Number Escorts Service Akola
Akola Call Girls #9907093804 Contact Number Escorts Service AkolaAkola Call Girls #9907093804 Contact Number Escorts Service Akola
Akola Call Girls #9907093804 Contact Number Escorts Service Akolasrsj9000
 
FULL ENJOY - 9953040155 Call Girls in Uttam Nagar | Delhi
FULL ENJOY - 9953040155 Call Girls in Uttam Nagar | DelhiFULL ENJOY - 9953040155 Call Girls in Uttam Nagar | Delhi
FULL ENJOY - 9953040155 Call Girls in Uttam Nagar | DelhiMalviyaNagarCallGirl
 
The First Date by Daniel Johnson (Inspired By True Events)
The First Date by Daniel Johnson (Inspired By True Events)The First Date by Daniel Johnson (Inspired By True Events)
The First Date by Daniel Johnson (Inspired By True Events)thephillipta
 
Laxmi Nagar Call Girls : ☎ 8527673949, Low rate Call Girls
Laxmi Nagar Call Girls : ☎ 8527673949, Low rate Call GirlsLaxmi Nagar Call Girls : ☎ 8527673949, Low rate Call Girls
Laxmi Nagar Call Girls : ☎ 8527673949, Low rate Call Girlsashishs7044
 
Aiims Call Girls : ☎ 8527673949, Low rate Call Girls
Aiims Call Girls : ☎ 8527673949, Low rate Call GirlsAiims Call Girls : ☎ 8527673949, Low rate Call Girls
Aiims Call Girls : ☎ 8527673949, Low rate Call Girlsashishs7044
 
Bur Dubai Call Girls O58993O4O2 Call Girls in Bur Dubai
Bur Dubai Call Girls O58993O4O2 Call Girls in Bur DubaiBur Dubai Call Girls O58993O4O2 Call Girls in Bur Dubai
Bur Dubai Call Girls O58993O4O2 Call Girls in Bur Dubaidajasot375
 
Pragati Maidan Call Girls : ☎ 8527673949, Low rate Call Girls
Pragati Maidan Call Girls : ☎ 8527673949, Low rate Call GirlsPragati Maidan Call Girls : ☎ 8527673949, Low rate Call Girls
Pragati Maidan Call Girls : ☎ 8527673949, Low rate Call Girlsashishs7044
 
Roadrunner Lodge, Motel/Residence, Tucumcari NM
Roadrunner Lodge, Motel/Residence, Tucumcari NMRoadrunner Lodge, Motel/Residence, Tucumcari NM
Roadrunner Lodge, Motel/Residence, Tucumcari NMroute66connected
 
FULL ENJOY - 9953040155 Call Girls in New Ashok Nagar | Delhi
FULL ENJOY - 9953040155 Call Girls in New Ashok Nagar | DelhiFULL ENJOY - 9953040155 Call Girls in New Ashok Nagar | Delhi
FULL ENJOY - 9953040155 Call Girls in New Ashok Nagar | DelhiMalviyaNagarCallGirl
 
Karol Bagh Call Girls : ☎ 8527673949, Low rate Call Girls
Karol Bagh Call Girls : ☎ 8527673949, Low rate Call GirlsKarol Bagh Call Girls : ☎ 8527673949, Low rate Call Girls
Karol Bagh Call Girls : ☎ 8527673949, Low rate Call Girlsashishs7044
 
Khanpur Call Girls : ☎ 8527673949, Low rate Call Girls
Khanpur Call Girls : ☎ 8527673949, Low rate Call GirlsKhanpur Call Girls : ☎ 8527673949, Low rate Call Girls
Khanpur Call Girls : ☎ 8527673949, Low rate Call Girlsashishs7044
 
Retail Store Scavanger Hunt - Foundation College Park
Retail Store Scavanger Hunt - Foundation College ParkRetail Store Scavanger Hunt - Foundation College Park
Retail Store Scavanger Hunt - Foundation College Parkjosebenzaquen
 
Call Girl in Bur Dubai O5286O4116 Indian Call Girls in Bur Dubai By VIP Bur D...
Call Girl in Bur Dubai O5286O4116 Indian Call Girls in Bur Dubai By VIP Bur D...Call Girl in Bur Dubai O5286O4116 Indian Call Girls in Bur Dubai By VIP Bur D...
Call Girl in Bur Dubai O5286O4116 Indian Call Girls in Bur Dubai By VIP Bur D...dajasot375
 
FULL ENJOY - 9953040155 Call Girls in Dwarka Mor | Delhi
FULL ENJOY - 9953040155 Call Girls in Dwarka Mor | DelhiFULL ENJOY - 9953040155 Call Girls in Dwarka Mor | Delhi
FULL ENJOY - 9953040155 Call Girls in Dwarka Mor | DelhiMalviyaNagarCallGirl
 
Downtown Call Girls O5O91O128O Pakistani Call Girls in Downtown
Downtown Call Girls O5O91O128O Pakistani Call Girls in DowntownDowntown Call Girls O5O91O128O Pakistani Call Girls in Downtown
Downtown Call Girls O5O91O128O Pakistani Call Girls in Downtowndajasot375
 
Call Girl Service in Karachi +923081633338 Karachi Call Girls
Call Girl Service in Karachi +923081633338 Karachi Call GirlsCall Girl Service in Karachi +923081633338 Karachi Call Girls
Call Girl Service in Karachi +923081633338 Karachi Call GirlsAyesha Khan
 
Olivia Cox. intertextual references.pptx
Olivia Cox. intertextual references.pptxOlivia Cox. intertextual references.pptx
Olivia Cox. intertextual references.pptxLauraFagan6
 
8377087607, Door Step Call Girls In Gaur City (NOIDA) 24/7 Available
8377087607, Door Step Call Girls In Gaur City (NOIDA) 24/7 Available8377087607, Door Step Call Girls In Gaur City (NOIDA) 24/7 Available
8377087607, Door Step Call Girls In Gaur City (NOIDA) 24/7 Availabledollysharma2066
 
9654467111 Full Enjoy @24/7 Call Girls In Saket Delhi Ncr
9654467111 Full Enjoy @24/7 Call Girls In Saket Delhi Ncr9654467111 Full Enjoy @24/7 Call Girls In Saket Delhi Ncr
9654467111 Full Enjoy @24/7 Call Girls In Saket Delhi NcrSapana Sha
 

Recently uploaded (20)

Akola Call Girls #9907093804 Contact Number Escorts Service Akola
Akola Call Girls #9907093804 Contact Number Escorts Service AkolaAkola Call Girls #9907093804 Contact Number Escorts Service Akola
Akola Call Girls #9907093804 Contact Number Escorts Service Akola
 
FULL ENJOY - 9953040155 Call Girls in Uttam Nagar | Delhi
FULL ENJOY - 9953040155 Call Girls in Uttam Nagar | DelhiFULL ENJOY - 9953040155 Call Girls in Uttam Nagar | Delhi
FULL ENJOY - 9953040155 Call Girls in Uttam Nagar | Delhi
 
The First Date by Daniel Johnson (Inspired By True Events)
The First Date by Daniel Johnson (Inspired By True Events)The First Date by Daniel Johnson (Inspired By True Events)
The First Date by Daniel Johnson (Inspired By True Events)
 
Laxmi Nagar Call Girls : ☎ 8527673949, Low rate Call Girls
Laxmi Nagar Call Girls : ☎ 8527673949, Low rate Call GirlsLaxmi Nagar Call Girls : ☎ 8527673949, Low rate Call Girls
Laxmi Nagar Call Girls : ☎ 8527673949, Low rate Call Girls
 
Aiims Call Girls : ☎ 8527673949, Low rate Call Girls
Aiims Call Girls : ☎ 8527673949, Low rate Call GirlsAiims Call Girls : ☎ 8527673949, Low rate Call Girls
Aiims Call Girls : ☎ 8527673949, Low rate Call Girls
 
Bur Dubai Call Girls O58993O4O2 Call Girls in Bur Dubai
Bur Dubai Call Girls O58993O4O2 Call Girls in Bur DubaiBur Dubai Call Girls O58993O4O2 Call Girls in Bur Dubai
Bur Dubai Call Girls O58993O4O2 Call Girls in Bur Dubai
 
Pragati Maidan Call Girls : ☎ 8527673949, Low rate Call Girls
Pragati Maidan Call Girls : ☎ 8527673949, Low rate Call GirlsPragati Maidan Call Girls : ☎ 8527673949, Low rate Call Girls
Pragati Maidan Call Girls : ☎ 8527673949, Low rate Call Girls
 
Roadrunner Lodge, Motel/Residence, Tucumcari NM
Roadrunner Lodge, Motel/Residence, Tucumcari NMRoadrunner Lodge, Motel/Residence, Tucumcari NM
Roadrunner Lodge, Motel/Residence, Tucumcari NM
 
FULL ENJOY - 9953040155 Call Girls in New Ashok Nagar | Delhi
FULL ENJOY - 9953040155 Call Girls in New Ashok Nagar | DelhiFULL ENJOY - 9953040155 Call Girls in New Ashok Nagar | Delhi
FULL ENJOY - 9953040155 Call Girls in New Ashok Nagar | Delhi
 
Dxb Call Girls # +971529501107 # Call Girls In Dxb Dubai || (UAE)
Dxb Call Girls # +971529501107 # Call Girls In Dxb Dubai || (UAE)Dxb Call Girls # +971529501107 # Call Girls In Dxb Dubai || (UAE)
Dxb Call Girls # +971529501107 # Call Girls In Dxb Dubai || (UAE)
 
Karol Bagh Call Girls : ☎ 8527673949, Low rate Call Girls
Karol Bagh Call Girls : ☎ 8527673949, Low rate Call GirlsKarol Bagh Call Girls : ☎ 8527673949, Low rate Call Girls
Karol Bagh Call Girls : ☎ 8527673949, Low rate Call Girls
 
Khanpur Call Girls : ☎ 8527673949, Low rate Call Girls
Khanpur Call Girls : ☎ 8527673949, Low rate Call GirlsKhanpur Call Girls : ☎ 8527673949, Low rate Call Girls
Khanpur Call Girls : ☎ 8527673949, Low rate Call Girls
 
Retail Store Scavanger Hunt - Foundation College Park
Retail Store Scavanger Hunt - Foundation College ParkRetail Store Scavanger Hunt - Foundation College Park
Retail Store Scavanger Hunt - Foundation College Park
 
Call Girl in Bur Dubai O5286O4116 Indian Call Girls in Bur Dubai By VIP Bur D...
Call Girl in Bur Dubai O5286O4116 Indian Call Girls in Bur Dubai By VIP Bur D...Call Girl in Bur Dubai O5286O4116 Indian Call Girls in Bur Dubai By VIP Bur D...
Call Girl in Bur Dubai O5286O4116 Indian Call Girls in Bur Dubai By VIP Bur D...
 
FULL ENJOY - 9953040155 Call Girls in Dwarka Mor | Delhi
FULL ENJOY - 9953040155 Call Girls in Dwarka Mor | DelhiFULL ENJOY - 9953040155 Call Girls in Dwarka Mor | Delhi
FULL ENJOY - 9953040155 Call Girls in Dwarka Mor | Delhi
 
Downtown Call Girls O5O91O128O Pakistani Call Girls in Downtown
Downtown Call Girls O5O91O128O Pakistani Call Girls in DowntownDowntown Call Girls O5O91O128O Pakistani Call Girls in Downtown
Downtown Call Girls O5O91O128O Pakistani Call Girls in Downtown
 
Call Girl Service in Karachi +923081633338 Karachi Call Girls
Call Girl Service in Karachi +923081633338 Karachi Call GirlsCall Girl Service in Karachi +923081633338 Karachi Call Girls
Call Girl Service in Karachi +923081633338 Karachi Call Girls
 
Olivia Cox. intertextual references.pptx
Olivia Cox. intertextual references.pptxOlivia Cox. intertextual references.pptx
Olivia Cox. intertextual references.pptx
 
8377087607, Door Step Call Girls In Gaur City (NOIDA) 24/7 Available
8377087607, Door Step Call Girls In Gaur City (NOIDA) 24/7 Available8377087607, Door Step Call Girls In Gaur City (NOIDA) 24/7 Available
8377087607, Door Step Call Girls In Gaur City (NOIDA) 24/7 Available
 
9654467111 Full Enjoy @24/7 Call Girls In Saket Delhi Ncr
9654467111 Full Enjoy @24/7 Call Girls In Saket Delhi Ncr9654467111 Full Enjoy @24/7 Call Girls In Saket Delhi Ncr
9654467111 Full Enjoy @24/7 Call Girls In Saket Delhi Ncr
 

Basic C Programming Rules

  • 1. Basic rules to begin: 1. In separate statement each instruction should be written. Therefore , complete C program consist of set of instructions. 2. The statements in program must be written in sequencial order to get desired output.Unless any logic problem can be arise. 3. All statement should written in small case letters. 4. C has no particular rules for position at which statement is to be typed. 5. In C program every statement must end with ; (semicolon).It act as a terminator. Rules for Comment:  Comment in the program should be enclosed within /* .. */ .Look example below the first line is comment. For ex. /*This my first program*/ #include<stdio.h> main() { Statement; Statement; }  Though comments are not necessary,but it good practice to begin program with comment indicating purpose of program so that other person can get idea of program.  You can write any number comment at any place in program mentioning the purpose of the statement.  Use few Comment instead of too many.  A comment cannot be nested. For ex., /* The/* first/*program*/*/*/.  A comment can split over more than one line. For ex. /*THE First Program*/ Main method:  main() is a collection of the set of statements. Statements are always enclosed belongs to main() within pairs of {} (opening and closing braces).For ex. void main() { 1st statement; 2nd statement; }  Technically main() is a function because every function has the pair of parentheses ( ) associated with it.
  • 2.  The function in c have their return type, Similarly, If we want that main() function should not return any value of particular type precede it with void ,int etc. Declaration:  Any variable used in the program must be declared before using it. For ex, int a,b,c; /*declaration*/ float a,b,c; /*declaration*/ a=a+b; /*usage*/  For declaration see the datatype table as follow: Datatype number Declaration format string Integer 1,+5,-5 int a; "%d", a Float 11.363,+1.14,-12.11 float a; "%f", a Double +1.123123,-1.234345 double a; "%l", a Character 'A','B' char a; "%c",a String "Dev.com" char a[20]; "%c",a  Ways of declaration in C lets see: a) While declaration you can also initialize it as int a=1,b=24; , float a=1.5, b=1.98+3.8*2.7; b) The order sometimes matter in initialization.For ex. int i = 1, j=24; is same as int j=24,j=1; float a=1.8 , b= 3.1+a; is alright but float b =3.1+a ,a=1.8; is not this why we have to initialize a before. c) Lets another statements: int x,y,z; x=y=z=10; work perfectly int x=y=z=10; not work because once again we are trying to use y (assign to y) before defining it. Statement:  For ex, float p,n, r,si; scanf("%f", &si); si= p*n*r/100; printf("%f", si); printf("problem done n");  you can notice *, / are arithmetic operator in C. C is very rich in operator hence there about 45 operator available in C.
  • 3.  For input use scanf("%d,%f",&a,&c); function i.e syntaxis scanf("<format string1>,<format string2>,...",&variable1 ,&variable2..);  For output use printf("%d,%f",&a,&c); function i.e syntaxis printf("<format string1>,<format string2>",variable1,variable2); , & is used in scanf function is must because it is "Address of operator".It gives the location number used by variable.  printf() function can print values of variable as well as print the result of an expression:for ex printf("%d,%d,%d,%d",3,3+2,c,a+b*c-d);.  Format specifier or format string are like %f, %d, %c, %l used for input and output.  n in the statement is for print output in next line. Linking:  To use printf() function it is necessary to use #include<stdio.h> at beginning of program.#include is the preprocessor directive.  #include<stdio.h> stands for standard input output,#include<conio.h> stands for control input output.These are most commonly used for Linking.