Presentation is loading. Please wait.

Presentation is loading. Please wait.

C language--Introduction. History 1970: B by Ken Thompson at AT&T Bell Lab 1972: C by Dennis Ritchie and Ken Tompson at At&T Bell Lab for UNIX 1978: “The.

Similar presentations


Presentation on theme: "C language--Introduction. History 1970: B by Ken Thompson at AT&T Bell Lab 1972: C by Dennis Ritchie and Ken Tompson at At&T Bell Lab for UNIX 1978: “The."— Presentation transcript:

1 C language--Introduction

2 History 1970: B by Ken Thompson at AT&T Bell Lab 1972: C by Dennis Ritchie and Ken Tompson at At&T Bell Lab for UNIX 1978: “The C Programming Language” by Brian Kernighan and Dennis Ritchie (K&R C) 1988: ANSI C

3 The First Program #include main( ) { printf(“Hello, World!\n"); }

4 How to use printf() 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);

5 How to use printf() int (integer values) uses %d float (floating point values) uses %f char (single character values) uses %c character strings (arrays of characters, discussed later) use %s

6 How to use scanf() scanf("%d", &b); –int uses %d –float uses %f –char uses %c –character strings use %s scanf("%d %d",&a, &b);


Download ppt "C language--Introduction. History 1970: B by Ken Thompson at AT&T Bell Lab 1972: C by Dennis Ritchie and Ken Tompson at At&T Bell Lab for UNIX 1978: “The."

Similar presentations


Ads by Google