coderstrust presentation on c language

11
C language Srabon sabbir trail student Coderstrust Ctg :005 Id 1478

Upload: srabon-sabbir

Post on 14-Apr-2017

301 views

Category:

Internet


0 download

TRANSCRIPT

Page 1: Coderstrust Presentation on C Language

C language

Srabon sabbir trail student Coderstrust Ctg :005 Id 1478

Page 2: Coderstrust Presentation on C Language

What is C Language

Invented by Ritchie

Invented in 1972

Published in 1978

Computer Language

Page 3: Coderstrust Presentation on C Language

Why use C Language

Mother language

Connect with registers

Run program fast

Develop apps & games

Page 4: Coderstrust Presentation on C Language

How a C program looks like

#include <stdio.h>int main (){ printf (“Hello World”); return 0;}

Header part

Main body

Page 5: Coderstrust Presentation on C Language

Keywords & Variables in C Language

int , float, char, if, else, for, while, switch, return, void. keywor

d

add_srabon, Add_srabon,ctg001, Addition, SUBTRACTION .

Variable

Page 6: Coderstrust Presentation on C Language

Data types and Constants in C Language

Integer data (-1, 0, 1) Float data (.-1, .1, .11) Character data (a ,b ,A)

Newline Character (\n) Horizontal tab (\t) Vertical tab (\v)

Data types

constant

Page 7: Coderstrust Presentation on C Language

An example of C program

#include <stdio.h>int main (){int a,b,add;printf (“Enter the numbers:”);scanf (“%d%d”,&a,&b);add=(a+b);printf (“The result is:%d\n”,add);return 0;}

Page 8: Coderstrust Presentation on C Language

Conditional operator

if, else if, else

print(true statement)

Conditions: block1&block2

trueprint(b

1)false

print(b2)

Page 9: Coderstrust Presentation on C Language

Looping in C Language

Continue execution

while loop , for loop,do while loop

Different times (10,100)

Page 10: Coderstrust Presentation on C Language

Function in C Language

Do fixed work

show result when called

Sub file of main function

Page 11: Coderstrust Presentation on C Language

ANY QUESTIONS?