Download presentation
Presentation is loading. Please wait.
Published byPeregrine Little Modified over 8 years ago
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);
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.