initial import
[staff/goc4/2018bti7061.git] / c-1-basics / examples / operatorsC / operators2.c
1 #include <stdio.h>
2
3 main(){
4
5 int i1;
6 int i2 = 4;
7 i1 = 3;
8 i1 = i2;
9 i1 = i2 * 4;
10 i1 = i2 + i1 + 5;
11
12 int i, j;
13 i = j = 5;
14 printf("i=%d, j=%d\n",i,j);
15 // Output : i=5, j=5
16
17 int i3=0;
18 i3 += 5; // i3 is 5
19 i3 *= 2; // i3 is 10
20 printf("i3=%d\n",i3);
21
22
23 int i4 = (i3<0) ? 0 : 100;
24 printf("i4=%d\n",i4);
25
26 float f1 = 1.5;
27 float f2 = 2.3;
28
29 float fmin = (f1<f2) ? f1 : f2;
30 printf("fmin=%f\n",fmin);
31
32
33 }