C-Programmierung: Interessante Rechnungen

 
	
	
Anweisung:                          |   Variablenwert danach
--------------------------------------------------------------
                                    |
1.)                                 |
int a=12; double y=2; int b=24      |    a=12
y=(a % 5)/b++;                      |    b=25
                                    |    y= 0
--------------------------------------------------------------
2.)                                 |
int =1,b=0; float x=3;              |    a= 1
x*=(float)(a/--b);                  |    b=-1
                                    |    x=-3
--------------------------------------------------------------
3.)                                 |
int a=4; double z=0.5; int b=2;     |    a=16
b+=(int) z * (a<<=2);               |    b= 2
                                    |    z=0.5
--------------------------------------------------------------
4.)                                 |
float q=(float)0, s=21.f; int c=2   |    c= 3
q -= s--/++c                        |    q=-7
                                    |    s=20
-------------------------------------------------------------- 
char `strings[]={"Hallo","ihr","da","drueben" }
--------------------------------------------------------------
Anweisung:                          |  ausgabe auf der Konsole
--------------------------------------------------------------
5.)                                 |
srings(3)                           |     drueben
--------------------------------------------------------------
6.)                                 |
*(strings+1)                        |     ihr
--------------------------------------------------------------
7.)                                 |
(*(strings+1))[1]                   |     h
--------------------------------------------------------------
8.)                                 |
*(strings[3]+1)                     |     r
--------------------------------------------------------------
9.)                                 |
*(*(strings+2)+1)                   |     a
--------------------------------------------------------------
10.)                                |
(**strings)+2                       |     J
--------------------------------------------------------------
11.)                                |
*(*(&strings))                      |     Hallo