SlideShare a Scribd company logo
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

Operators
OperatorsOperators
Operators
Allah Ditta
 
1584503386 1st chap
1584503386 1st chap1584503386 1st chap
1584503386 1st chap
thuhiendtk4
 
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
Akanchha Agrawal
 
Ch3 selection
Ch3 selectionCh3 selection
Ch3 selection
Hattori Sidek
 
C lecture 3 control statements slideshare
C lecture 3 control statements slideshareC lecture 3 control statements slideshare
C lecture 3 control statements slideshare
Gagan Deep
 
Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7
alish sha
 
Dti2143 lab sheet 6
Dti2143 lab sheet 6Dti2143 lab sheet 6
Dti2143 lab sheet 6
alish sha
 
Lab 1
Lab 1Lab 1
Infix-Postfix expression conversion
Infix-Postfix expression conversionInfix-Postfix expression conversion
Infix-Postfix expression conversion
Rashmiranja625
 
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 & Branching
Hemantha Kulathilake
 
Mycasestudy
MycasestudyMycasestudy
Mycasestudy
Emmanuel college
 
Operators and expressions in c language
Operators and expressions in c languageOperators and expressions in c language
Operators and expressions in c language
tanmaymodi4
 
C programming Lab 1
C programming Lab 1C programming Lab 1
C programming Lab 1
Zaibi Gondal
 
Cinfo
CinfoCinfo
Cinfo
teach4uin
 
Programming fundamentals
Programming fundamentalsProgramming fundamentals
Programming fundamentals
Zaibi Gondal
 
Decision statements in c language
Decision statements in c languageDecision statements in c language
Decision statements in c language
tanmaymodi4
 
First c program
First c programFirst c program
First c program
Komal Pardeshi
 
Assignment7
Assignment7Assignment7
Assignment7
Sunita Milind Dol
 

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
 
Resume_Bindhu (2)
Resume_Bindhu (2)Resume_Bindhu (2)
Resume_Bindhu (2)
Bindhu Kashyap
 
Pepe Mujica
Pepe MujicaPepe Mujica
Pepe Mujica
angelica delgado
 
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
Mary Jones
 
Digital wallet
Digital walletDigital wallet
Digital wallet
Lokesh Jajoo
 
oligopoly
oligopolyoligopoly
oligopoly
zuha handoo
 
Why should we donate blood
Why should we donate bloodWhy should we donate blood
Why should we donate blood
sykat 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
 
Atos ecarga brochure_ sk
Atos ecarga brochure_ skAtos ecarga brochure_ sk
Atos ecarga brochure_ sk
Jaroslav Sabolik
 
Top Holiday Weekend campaigns of 2016
Top Holiday Weekend campaigns of 2016Top Holiday Weekend campaigns of 2016
Top Holiday Weekend campaigns of 2016
Gabrielle Retcho, Digital Marketer
 
George Michael
George MichaelGeorge Michael
George Michael
MPresentations
 
Transposicion didaíctica
Transposicion didaícticaTransposicion didaíctica
Transposicion didaíctica
Karla Sepulveda Obreque
 

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 C 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
 
Functions.pptx, programming language in c
Functions.pptx, programming language in cFunctions.pptx, programming language in c
Functions.pptx, programming language in c
floraaluoch3
 
Presentation 2 (1).pdf
Presentation 2 (1).pdfPresentation 2 (1).pdf
Presentation 2 (1).pdf
ziyadaslanbey
 
Programming in C
Programming in CProgramming in C
Programming in C
Nishant Munjal
 
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
 
C programming
C programmingC programming
C programming
PralhadKhanal1
 
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 structures
Pradipta Mishra
 
C programming
C programmingC programming
C programming
saniabhalla
 
What is c
What is cWhat is c
What is c
Nitesh Saitwal
 
C language updated
C language updatedC language updated
C language updated
Arafat Bin Reza
 
Ch2 introduction to c
Ch2 introduction to cCh2 introduction to c
Ch2 introduction to c
Hattori Sidek
 
88 c-programs
88 c-programs88 c-programs
88 c-programs
Leandro Schenone
 
Overview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya JyothiOverview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya Jyothi
Sowmya Jyothi
 
Programming Fundamentals lecture 5
Programming Fundamentals lecture 5Programming Fundamentals lecture 5
Programming Fundamentals lecture 5
REHAN 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.pptx
ssuser71a90c
 
C programming
C programmingC programming
C programming
Rounak Samdadia
 
Complete C programming Language Course
Complete C programming Language CourseComplete C programming Language Course
Complete C programming Language Course
Vivek chan
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
Mohammed Saleh
 
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
THE NORTHCAP UNIVERSITY
 

Similar to C 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...
 
Functions.pptx, programming language in c
Functions.pptx, programming language in cFunctions.pptx, programming language in c
Functions.pptx, programming language in c
 
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
 

Recently uploaded

Dino Ranch Storyboard / Kids TV Advertising
Dino Ranch Storyboard / Kids TV AdvertisingDino Ranch Storyboard / Kids TV Advertising
Dino Ranch Storyboard / Kids TV Advertising
Alessandro Occhipinti
 
FinalA1LessonPlanMaking.docxdvdnlskdnvsldkvnsdkvn
FinalA1LessonPlanMaking.docxdvdnlskdnvsldkvnsdkvnFinalA1LessonPlanMaking.docxdvdnlskdnvsldkvnsdkvn
FinalA1LessonPlanMaking.docxdvdnlskdnvsldkvnsdkvn
abbieharman
 
ART APPRECIATION DISCUSSION LESSON 9.pptx
ART APPRECIATION DISCUSSION  LESSON 9.pptxART APPRECIATION DISCUSSION  LESSON 9.pptx
ART APPRECIATION DISCUSSION LESSON 9.pptx
AlizzaJoyceManuel
 
Tibbetts_HappyAwesome_NewArc Sketch to AI
Tibbetts_HappyAwesome_NewArc Sketch to AITibbetts_HappyAwesome_NewArc Sketch to AI
Tibbetts_HappyAwesome_NewArc Sketch to AI
Todd Tibbetts
 
My storyboard for a sword fight scene with lightsabers
My storyboard for a sword fight scene with lightsabersMy storyboard for a sword fight scene with lightsabers
My storyboard for a sword fight scene with lightsabers
AlejandroGuarnGutirr
 
storyboard: Victor and Verlin discussing about top hat
storyboard: Victor and Verlin discussing about top hatstoryboard: Victor and Verlin discussing about top hat
storyboard: Victor and Verlin discussing about top hat
LyneSun
 
A Brief Introduction About Hadj Ounis
A Brief  Introduction  About  Hadj OunisA Brief  Introduction  About  Hadj Ounis
A Brief Introduction About Hadj Ounis
Hadj Ounis
 
一比一原版美国亚利桑那大学毕业证(ua毕业证书)如何办理
一比一原版美国亚利桑那大学毕业证(ua毕业证书)如何办理一比一原版美国亚利桑那大学毕业证(ua毕业证书)如何办理
一比一原版美国亚利桑那大学毕业证(ua毕业证书)如何办理
homgo
 
Ealing London Independent Photography meeting - June 2024
Ealing London Independent Photography meeting - June 2024Ealing London Independent Photography meeting - June 2024
Ealing London Independent Photography meeting - June 2024
Sean McDonnell
 
Colour Theory for Painting - Fine Artist.pdf
Colour Theory for Painting - Fine Artist.pdfColour Theory for Painting - Fine Artist.pdf
Colour Theory for Painting - Fine Artist.pdf
Ketan Naik
 
Heart Touching Romantic Love Shayari In English with Images
Heart Touching Romantic Love Shayari In English with ImagesHeart Touching Romantic Love Shayari In English with Images
Heart Touching Romantic Love Shayari In English with Images
Short Good Quotes
 
Codes n Conventions Website Media studies.pptx
Codes n Conventions Website Media studies.pptxCodes n Conventions Website Media studies.pptx
Codes n Conventions Website Media studies.pptx
ZackSpencer3
 
2024 MATFORCE Youth Poster Contest Winners
2024 MATFORCE Youth Poster Contest Winners2024 MATFORCE Youth Poster Contest Winners
2024 MATFORCE Youth Poster Contest Winners
matforce
 
一比一原版加拿大多伦多大学毕业证(uoft毕业证书)如何办理
一比一原版加拿大多伦多大学毕业证(uoft毕业证书)如何办理一比一原版加拿大多伦多大学毕业证(uoft毕业证书)如何办理
一比一原版加拿大多伦多大学毕业证(uoft毕业证书)如何办理
taqyea
 
哪里购买美国乔治城大学毕业证硕士学位证书原版一模一样
哪里购买美国乔治城大学毕业证硕士学位证书原版一模一样哪里购买美国乔治城大学毕业证硕士学位证书原版一模一样
哪里购买美国乔治城大学毕业证硕士学位证书原版一模一样
tc73868
 
Domino Express Storyboard - TV Adv Toys 30"
Domino Express Storyboard - TV Adv Toys 30"Domino Express Storyboard - TV Adv Toys 30"
Domino Express Storyboard - TV Adv Toys 30"
Alessandro Occhipinti
 
Cherries 32 collection of colorful paintings
Cherries 32 collection of colorful paintingsCherries 32 collection of colorful paintings
Cherries 32 collection of colorful paintings
sandamichaela *
 
My storyboard for the short film "Maatla".
My storyboard for the short film "Maatla".My storyboard for the short film "Maatla".
My storyboard for the short film "Maatla".
AlejandroGuarnGutirr
 
All the images mentioned in 'See What You're Missing'
All the images mentioned in 'See What You're Missing'All the images mentioned in 'See What You're Missing'
All the images mentioned in 'See What You're Missing'
Dave Boyle
 
FinalFinalSelf-PortraiturePowerPoint.pptx
FinalFinalSelf-PortraiturePowerPoint.pptxFinalFinalSelf-PortraiturePowerPoint.pptx
FinalFinalSelf-PortraiturePowerPoint.pptx
abbieharman
 

Recently uploaded (20)

Dino Ranch Storyboard / Kids TV Advertising
Dino Ranch Storyboard / Kids TV AdvertisingDino Ranch Storyboard / Kids TV Advertising
Dino Ranch Storyboard / Kids TV Advertising
 
FinalA1LessonPlanMaking.docxdvdnlskdnvsldkvnsdkvn
FinalA1LessonPlanMaking.docxdvdnlskdnvsldkvnsdkvnFinalA1LessonPlanMaking.docxdvdnlskdnvsldkvnsdkvn
FinalA1LessonPlanMaking.docxdvdnlskdnvsldkvnsdkvn
 
ART APPRECIATION DISCUSSION LESSON 9.pptx
ART APPRECIATION DISCUSSION  LESSON 9.pptxART APPRECIATION DISCUSSION  LESSON 9.pptx
ART APPRECIATION DISCUSSION LESSON 9.pptx
 
Tibbetts_HappyAwesome_NewArc Sketch to AI
Tibbetts_HappyAwesome_NewArc Sketch to AITibbetts_HappyAwesome_NewArc Sketch to AI
Tibbetts_HappyAwesome_NewArc Sketch to AI
 
My storyboard for a sword fight scene with lightsabers
My storyboard for a sword fight scene with lightsabersMy storyboard for a sword fight scene with lightsabers
My storyboard for a sword fight scene with lightsabers
 
storyboard: Victor and Verlin discussing about top hat
storyboard: Victor and Verlin discussing about top hatstoryboard: Victor and Verlin discussing about top hat
storyboard: Victor and Verlin discussing about top hat
 
A Brief Introduction About Hadj Ounis
A Brief  Introduction  About  Hadj OunisA Brief  Introduction  About  Hadj Ounis
A Brief Introduction About Hadj Ounis
 
一比一原版美国亚利桑那大学毕业证(ua毕业证书)如何办理
一比一原版美国亚利桑那大学毕业证(ua毕业证书)如何办理一比一原版美国亚利桑那大学毕业证(ua毕业证书)如何办理
一比一原版美国亚利桑那大学毕业证(ua毕业证书)如何办理
 
Ealing London Independent Photography meeting - June 2024
Ealing London Independent Photography meeting - June 2024Ealing London Independent Photography meeting - June 2024
Ealing London Independent Photography meeting - June 2024
 
Colour Theory for Painting - Fine Artist.pdf
Colour Theory for Painting - Fine Artist.pdfColour Theory for Painting - Fine Artist.pdf
Colour Theory for Painting - Fine Artist.pdf
 
Heart Touching Romantic Love Shayari In English with Images
Heart Touching Romantic Love Shayari In English with ImagesHeart Touching Romantic Love Shayari In English with Images
Heart Touching Romantic Love Shayari In English with Images
 
Codes n Conventions Website Media studies.pptx
Codes n Conventions Website Media studies.pptxCodes n Conventions Website Media studies.pptx
Codes n Conventions Website Media studies.pptx
 
2024 MATFORCE Youth Poster Contest Winners
2024 MATFORCE Youth Poster Contest Winners2024 MATFORCE Youth Poster Contest Winners
2024 MATFORCE Youth Poster Contest Winners
 
一比一原版加拿大多伦多大学毕业证(uoft毕业证书)如何办理
一比一原版加拿大多伦多大学毕业证(uoft毕业证书)如何办理一比一原版加拿大多伦多大学毕业证(uoft毕业证书)如何办理
一比一原版加拿大多伦多大学毕业证(uoft毕业证书)如何办理
 
哪里购买美国乔治城大学毕业证硕士学位证书原版一模一样
哪里购买美国乔治城大学毕业证硕士学位证书原版一模一样哪里购买美国乔治城大学毕业证硕士学位证书原版一模一样
哪里购买美国乔治城大学毕业证硕士学位证书原版一模一样
 
Domino Express Storyboard - TV Adv Toys 30"
Domino Express Storyboard - TV Adv Toys 30"Domino Express Storyboard - TV Adv Toys 30"
Domino Express Storyboard - TV Adv Toys 30"
 
Cherries 32 collection of colorful paintings
Cherries 32 collection of colorful paintingsCherries 32 collection of colorful paintings
Cherries 32 collection of colorful paintings
 
My storyboard for the short film "Maatla".
My storyboard for the short film "Maatla".My storyboard for the short film "Maatla".
My storyboard for the short film "Maatla".
 
All the images mentioned in 'See What You're Missing'
All the images mentioned in 'See What You're Missing'All the images mentioned in 'See What You're Missing'
All the images mentioned in 'See What You're Missing'
 
FinalFinalSelf-PortraiturePowerPoint.pptx
FinalFinalSelf-PortraiturePowerPoint.pptxFinalFinalSelf-PortraiturePowerPoint.pptx
FinalFinalSelf-PortraiturePowerPoint.pptx
 

C 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.