The C Language - PowerPoint PPT Presentation

About This Presentation
Title:

The C Language

Description:

... 1963 CPL ( ) 1966 BCPL ... The C Language History of C PowerPoint ... – PowerPoint PPT presentation

Number of Views:50
Avg rating:3.0/5.0
Slides: 18
Provided by: tfg7
Category:

less

Transcript and Presenter's Notes

Title: The C Language


1
The C Language
2
History of C
  • ? ? 1960 ? Algo 60 ? ? ( International Committe
    )
  • ? ? 1963 ? CPL ? ? ( ? ? ? ? ? ? ? )
  • ? ? 1966 ? BCPL ? ? ? ( ???? Martin Richards )
  • ? ? 1970 ? B ? ? ( ATT Ken Thompson )
  • ? ? 1972 ? C ? ? ( ATT Dennis Ritchie )

3
(No Transcript)
4
Program I The happiness is
????
  • include ltstdio.hgt
  • include ltstdlib.hgt
  • int main( )
  • printf("?????? ")
  • printf("??????????!\n ")
  • system("PAUSE")
  • return 0

5
Program II 5 7 ? ????
  • include ltstdio.hgt
  • include ltstdlib.hgt
  • int main()
  • int a, b, c
  • a 5
  • b 7
  • c a b
  • printf("d d d\n", a, b, c)
  • system("PAUSE")
  • return 0

a
b
c
5
7
12
57
6
Program III How old are you ?
  • include ltstdio.hgt ????
  • include ltstdlib.hgt
  • int main( )
  • int myage
  • myage 16
  • printf("I am d years old. \n", myage)
  • printf("Next year, I will be d years old.
    \n", myage1)
  • system("PAUSE")
  • return 0

7
How printf( ) work?
  • printf("Hello")
  • printf("Hello\n")
  • printf("d", b)
  • printf("The temperature is ")
  • printf("d", b)
  • printf(" degrees\n")
  • printf("The temperature is d degrees\n", b)
  • printf("d d d\n", a, b, c)

8
????
  • (character, ??) char
  • (integer, ??) int
  • (long integer, ???) long
  • (short integer, ???) short
  • (???) float
  • (??????) double

?1 byte ?4 bytes ?4 bytes ?2 bytes ?4 bytes ?8
bytes
9
How printf( ) work?
  • int (??) uses d
  • float (???) uses f
  • char (??) uses c
  • character strings(??)use s

10
??
  • ????????,??????????(?num????stud?????)
  • ???????
  • ????C???????
  • ???????????????
  • ??????????????
  • ????????
  • ???????????

11
?????
  •  

12
???????????
  • ??(??)
  • ???? C 25
  • ?
  • ???? F
  • ???(?? F 9/5 C 32)
  • F (float)C 9 / 5 32
  • ?????? F ?? xx.xx (.2f)

13
??BMI (?)
  • ??(??)
  • ?? height 168
  • ?? weight 55
  • ?BMI
  • ???
  • BMI weight / (height)2
  • (????????????????)
  • BMI weight/(heightheight/10000)
  • ???? BMI ??xx.xx (.2f)
  • ????

14
Program IV a b ? ????
  • include ltstdio.hgt
  • include ltstdlib.hgt
  • int main()
  • int a, b, c
  • printf("Enter the first value")
  • scanf("d", a)
  • printf("Enter the second value")
  • scanf("d", b)
  • c a b
  • printf("d d d\n", a, b, c)
  • system("PAUSE")
  • return 0

15
Program V How old are you ?
  • include ltstdio.hgt ????
  • include ltstdlib.hgt
  • int main()
  • int yourage
  • printf("How old are you?")
  • scanf("d", yourage)
  • printf("Next Year, you will be d years
    old.\n", yourage1)
  • system("PAUSE")
  • return 0

16
How scanf() work?
  • scanf("d", b)
  • int uses d
  • float uses f
  • char uses c
  • character strings use s
  • scanf("d d", a, b)
  • scanf("d,d", a, b)
  • ?????????

17
??BMI (?)
  • ????(height), ??(weight)
  • ???
  • BMI weight / (height)2
  • BMI weight / (height height)
  • (????????????????)
  • ????BMI??xx.xx

  • ????
Write a Comment
User Comments (0)
About PowerShow.com