Syntaxe jazyka C: definice proměnných, příkazy printf/scanf, práce se soubory, pole, strukturované proměnné. Definice funkce a její volání.
|
#include <stdio.h> main() { printf("Ahoj "); printf("svete!\n"); }
#include <stdio.h> #include <math.h> main() { float x; int k; float y; x = 2.71; k = 5; y = x + k * k * k; }
#include <stdio.h> #include <math.h> main() { float x; int k; x = 3.1415; k = 5; printf("Hodnota prommenne: %f\n", x); printf("Hodnota prommenne: %i\n", k); }
#include <stdio.h> #include <math.h> main() { float x; int k; scanf("%f", &x); scanf("%i", &k); }
#include <stdio.h> #include <math.h> main() { float r, obsah; scanf("%f", &r); obsah = M_PI * r * r; printf("Obsah kruhu je %f\n", obsah); }