|
C language--introduction History 1970: b by Ken Thompson at at&t bell Lab
|
tarix | 08.08.2018 | ölçüsü | 13,5 Kb. | | #61496 |
|
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
#include main( ) { printf(“Hello, World!\n"); }
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);
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
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);
Dostları ilə paylaş: |
|
|