© М.Л. Цымблер (mzym@susu.ru), Е.В. Аксенова (evaksen@mail.ru)
#include <stdio.h>
void main()
{
double x = 5 / 2;
printf("%g\n", x);
return;
}
#include <stdio.h>
void main()
{
int a = 4, b = 3, c;
c = a-- + b;
printf("%d, %d, %d\n", a, b, c);
c = --a + b;
printf("%d, %d, %d\n", a, b, c);
return;
}
#include <stdio.h>
void main()
{
int a = 5, b = -5;
while (a-- > 0 || b++ > 0)
printf("%d %d\n", a, b);
return;
}
/* пример Bjarne Stroustrup-а */
#include <stdio.h>
int a = 1;
void f()
{
int b = 1;
static int c = 1;
printf("a=%d b=%d c=%d\n", a++, b++, c++);
return;
}
void main()
{
while (a < 4)
f();
return;
}
#include <stdio.h>
double x = 1.17;
double y = x * 2.0;
void main()
{
double z = x + 1.9;
// ...
return;
}