Script started on Wed Oct 28 18:12:59 2015 $ date Mi 28 Okt 2015 18:38:36 CET $ pwd /usr/home/ckurs $ cd src $ ls a.out hello hello.c $ cat hello.c /* Ein einfaches C-Programm */ /* * Ein längerer Kommentar */ // ein einzeiliger Kommentar #include int main() { printf("hello, world!\n"); return 0; } $ nl helloc ,c  .c 1 /* Ein einfaches C-Programm */ 2 /* 3 * Ein längerer Kommentar 4 */ 5 // ein einzeiliger Kommentar 6 #include 7 int main() 8 { 9 printf("hello, world!\n"); 10 return 0; 11 } $ ed convert.c convert.c: No such file or directory a #include int main() { printf("Ergebnis: %d" \n", 1 + 1);  return 0; } - . $d ,p n 1 #include 2 3 int main() 4 { 5 printf("Ergebnis: %d\n", 1 + 1); 6 7 return 0; 8 } !cc convert.c         -o convert convert.c cc: error: no such file or directory: 'convert.c' cc: error: no input files ! w 81 !! cc -o convert convert.c ! !./convert Ergebnis: 2 ! c5 ? h invalid command suffix 5c pri    printf("Ergebnis: %d\n", 17 + 4=:  ); . w 83 !cc -o convert convert.c && ./convert Ergebnis: 21 ! ,n 1 #include 2 3 int main() 4 { 5 printf("Ergebnis: %d\n", 17 + 4); 6 7 return 0; 8 } 5i int x; . ,n 1 #include 2 3 int main() 4 { 5 int x; 6 7 printf("Ergebnis: %d\n", 17 + 4); 8 9 return 0; 10 } 7c  c x = 17 + 4; printf("Ergb ebnis: %d\n"); . w 96 !! cc -o convert convert.c && ./convert convert.c:8:21: warning: more '%' conversions than data arguments [-Wformat] printf("Ergebnis: %d\n");  ~^ 1 warning generated. Ergebnis: -5256 ! 8c printf("Er  Ergb ebnis: %s d\n, x); . w 98 ,n 1 #include 2 3 int main() 4 { 5 int x; 6 7 x = 17 + 4; 8 printf("Ergebnis: %d\n, x); 9 10 return 0; 11 } !! cc -o convert convert.c && ./convert convert.c:8:9: warning: missing terminating '"' character [-Winvalid-pp-token] printf("Ergebnis: %d\n, x);  ^ convert.c:8:9: error: expected expression 1 warning and 1 error generated. ! 8s/m n,/n", ,/ 8p printf("Ergebnis: %d\n", x); w 99 !! cc -o convert convert.c && ./convert Ergebnis: 21 ! ,p #include int main() { int x; x = 17 + 4; printf("Ergebnis: %d\n", x); return 0; } 0 ,n n 1 #include 2 3 int main() 4 { 5 int x; 6 7 x = 17 + 4; 8 printf("Ergebnis: %d\n", x); 9 10 return 0; 11 } P *7c x = 1000 * 1000 * 1000; . *w 111 *!! cc -o convert convert.c && ./convert Ergebnis: 1000000000 ! *5c long x; . *w 112 *!! cc -o convert convert.c && ./convert convert.c:8:27: warning: format specifies type 'int' but the argument has type 'long' [-Wformat] printf("Ergebnis: %d\n", x);  ~~ ^  %ld 1 warning generated. Ergebnis: 1000000000 ! *,p #include int main() { long x; x = 1000 * 1000 * 1000; printf("Ergebnis: %d\n", x); return 0; } *,n 1 #include 2 3 int main() 4 { 5 long x; 6 7 x = 1000 * 1000 * 1000; 8 printf("Ergebnis: %d\n", x); 9 10 return 0; 11 } *8c printf("Ergebnis: %R ld \n". x  ,x   x); - . *w 113 *!! cc -o convert convert.c && ./convert Ergebnis: 1000000000 ! *5c short x; 8 . *8x c printf("Ergebnis: %hd\n" , x); . *w 114 *!! cc -o convert convert.c && ./convert convert.c:7:18: warning: implicit conversion from 'int' to 'short' changes value from 1000000000 to -13824 [-Wconstant-conversion] x = 1000 * 1000 * 1000;  ~ ~~~~~~~~~~~~^~~~~~ 1 warning generated. Ergebnis: -13824 ! *^D$ vc  bc 123456  * 12445647; 55009320 09320 obase 16 bc: stdin:2: syntax error: newline unexpected obase = 16 12345 3039 1000 * 1000 * 1000 3B9ACA00 ibsase = 16 obase = A CA==00 51712 899000 10000 -  CA00 - 10000 -13824 $ ca  t convetr  rt.c #include int main() { short x; x = 1000 * 1000 * 1000; printf("Ergebnis: %hd\n", x); return 0; } $ rm convert.c $ ed convert.c convert.c: No such file or directory a # #include int main() { int min = 0; , ste  sch   chritt = 10, max = 30  100; int zaeh  ehler , ergebnis; for / (zaehler = 0 min; zahl  ehler y <= max; a zahele    ehler = zah ehler + schritt) [ { ergebnis = ergeb     zah ehler * 9 / 5 + 32; printf("C %d\t^[[D   %d\n", zah ehler, ergebnis); } return 0; } - . ew  w 258 !cc -p c  o convert convert.c && ./convert 0 32 10 50 20 68 30 86 40 104 50 122 60 140 70 158 80 176 90 194 100 212 ! ,n 1 #include 2 3 int main() 4 { 5 int min = 0, schritt = 10, max = 100; 6 int zaehler, ergebnis; 7 8 for (zaehler = min; zaehler <= max; zaehler = zaehler + schritt) { 9 ergebnis = zaehler * 9 / 5 + 32; 10 printf("%d\t%d\n", zaehler, ergebnis); 11 } 12 13 return 0; 14 } 10c printf("%6d\t%d 6d" \n", zaheler     ehler, ergebnis); . w 260 !! cc -o convert convert.c && ./convert 0 32 10 50 20 68 30 86 40 104 50 122 60 140 70 158 80 176 90 194 100 212 ! ******      ,ü p ? j jh  h unknown command ,p #include int main() { int min = 0, schritt = 10, max = 100; int zaehler, ergebnis; for (zaehler = min; zaehler <= max; zaehler = zaehler + schritt) { ergebnis = zaehler * 9 / 5 + 32; printf("%6d\t%6d\n", zaehler, ergebnis); } return 0; } ,n 1 #include 2 3 int main() 4 { 5 int min = 0, schritt = 10, max = 100; 6 int zaehler, ergebnis; 7 8 for (zaehler = min; zaehler <= max; zaehler = zaehler + schritt) { 9 ergebnis = zaehler * 9 / 5 + 32; 10 printf("%6d\t%6d\n", zaehler, ergebnis); 11 } 12 13 return 0; 14 } 6c int zaehler; double ergebnis; . 11c printf("%6d\t%6f\n", zaehoe  ler, ergebns is); . ,p #include int main() { int min = 0, schritt = 10, max = 100; int zaehler; double ergebnis; for (zaehler = min; zaehler <= max; zaehler = zaehler + schritt) { ergebnis = zaehler * 9 / 5 + 32; printf("%6d\t%6f\n", zaehler, ergebnis); } return 0; } w 268 !! cc -o convert convert.c && ./convert 0 32.000000 10 50.000000 20 68.000000 30 86.000000 40 104.000000 50 122.000000 60 140.000000 70 158.000000 80 176.000000 90 194.000000 100 212.000000 ! ,p #include int main() { int min = 0, schritt = 10, max = 100; int zaehler; double ergebnis; for (zaehler = min; zaehler <= max; zaehler = zaehler + schritt) { ergebnis = zaehler * 9 / 5 + 32; printf("%6d\t%6f\n", zaehler, ergebnis); } return 0; } ,n 1 #include 2 3 int main() 4 { 5 int min = 0, schritt = 10, max = 100; 6 int zaehler; 7 double ergebnis; 8 9 for (zaehler = min; zaehler <= max; zaehler = zaehler + schritt) { 10 ergebnis = zaehler * 9 / 5 + 32; 11 printf("%6d\t%6f\n", zaehler, ergebnis); 12 } 13 14 return 0; 15 } 10c ergebnis = zaehler * 9.0 / 5 + 32 ; . erge ebnis = (double)zaehler * 9 / 5 + 2 32;                                11 printf("%6d\t%6f\n", zaehler, ergebnis); 11c printf       printf("%7d  6d\t%6.2f\n", zaehler, ergebnis); . ,n 1 #include 2 3 int main() 4 { 5 int min = 0, schritt = 10, max = 100; 6 int zaehler; 7 double ergebnis; 8 9 for (zaehler = min; zaehler <= max; zaehler = zaehler + schritt) { 10 ergebnis = zaehler * 9.0 / 5 + 32; 11 printf("%6d\t%6.2f\n", zaehler, ergebnis); 12 } 13 14 return 0; 15 } w 272 !! cc -o convert convert.c && ./convert 0 32.00 10 50.00 20 68.00 30 86.00 40 104.00 50 122.00 60 140.00 70 158.00 80 176.00 90 194.00 100 212.00 ! ,p #include int main() { int min = 0, schritt = 10, max = 100; int zaehler; double ergebnis; for (zaehler = min; zaehler <= max; zaehler = zaehler + schritt) { ergebnis = zaehler * 9.0 / 5 + 32; printf("%6d\t%6.2f\n", zaehler, ergebnis); } return 0; } ,n 1 #include 2 3 int main() 4 { 5 int min = 0, schritt = 10, max = 100; 6 int zaehler; 7 double ergebnis; 8 9 for (zaehler = min; zaehler <= max; zaehler = zaehler + schritt) { 10 ergebnis = zaehler * 9.0 / 5 + 32; 11 printf("%6d\t%6.2f\n", zaehler, ergebnis); 12 } 13 14 return 0; 15 } 5c s/10,/4,/p int min = 0, schritt = 4, max = 100; w 271 !! cc -o convert convert.c && ./convert 0 32.00 4 39.20 8 46.40 12 53.60 16 60.80 20 68.00 24 75.20 28 82.40 32 89.60 36 96.80 40 104.00 44 111.20 48 118.40 52 125.60 56 132.80 60 140.00 64 147.20 68 154.40 72 161.60 76 168.80 80 176.00 84 183.20 88 190.40 92 197.60 96 204.80 100 212.00 ! ^D$ ls a.out convert convert.c hello hello.c $ Script done on Wed Oct 28 20:17:27 2015