update
This commit is contained in:
Binary file not shown.
@@ -1,47 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
int main() {
|
||||
int i;
|
||||
printf("\n");
|
||||
for (i=12; i>=0; i=i-2) {
|
||||
if (i==0){
|
||||
|
||||
printf("%d \n", i);
|
||||
}
|
||||
else {
|
||||
printf("%d, ", i);
|
||||
}
|
||||
}
|
||||
|
||||
for (i=-1; i>=-13; i=i-2){
|
||||
if (i==-13){
|
||||
printf("%d \n", i);
|
||||
}
|
||||
else {
|
||||
printf("%d, ", i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (i=0; i<=9; i++){
|
||||
if (i == 9){
|
||||
printf("%d \n", (int)pow(i,(double)2));
|
||||
}
|
||||
else{
|
||||
printf("%d, ", (int)pow(i,(double)2));
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0; i<=9; i++){
|
||||
if (i==9){
|
||||
printf("%d \n", i*i);
|
||||
}
|
||||
else{
|
||||
printf("%d, ", i*i);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
/* formatelemente.c
|
||||
*
|
||||
* ACHTUNG: Enthaelt Fehler, die Sie bereinigen sollen!
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
main()i {
|
||||
int i = 66;
|
||||
double x = .000007;
|
||||
double y = 123.45;
|
||||
|
||||
printf("\ni:\n%d \n%o \n%x \n%X", i, i, i, i);
|
||||
|
||||
printf("\nx:\n%f \n%e \n%E \n%g \n%G", x, x, x, x, x);
|
||||
|
||||
printf("\ny:\n%g \n%G \n", y,y);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
int main() {
|
||||
int fahrenheit = 0;
|
||||
int stepsize = 20;
|
||||
int maxF = 300;
|
||||
|
||||
double celsius;
|
||||
|
||||
printf("\n%s %s %s \n", "Fahrenheit","Celsius (gerundet)","Celsius (exakt)");
|
||||
|
||||
while (fahrenheit <= maxF) {
|
||||
celsius = (5.0/9.0) * (fahrenheit - 32);
|
||||
printf("%d\t\t%d\t\t%f\n", fahrenheit, (int)celsius, celsius);
|
||||
fahrenheit += stepsize;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main (){
|
||||
|
||||
printf("\n Ich kenn die Formatelemente zu 100%% \n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
/* typengroesse.c
|
||||
*
|
||||
* Bestimmung der Groesse der einfachen typen mit sizeof
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
char c = 127;
|
||||
unsigned char uc = 255;
|
||||
|
||||
printf("\n");
|
||||
|
||||
//Ganzzahltypen
|
||||
printf("char: \t\t%2d\n", (int) sizeof c);
|
||||
printf("uns. char: \t%2d\n", (int) sizeof uc);
|
||||
|
||||
printf("short: \t\t%2d\n", (int) sizeof (short));
|
||||
printf("uns. short: \t%2d\n", (int) sizeof (unsigned short));
|
||||
|
||||
printf("int: \t\t%2d\n", (int) sizeof (int));
|
||||
printf("uns. int: \t%2d\n", (int) sizeof (unsigned int));
|
||||
|
||||
printf("long: \t\t%2d \n", (int) sizeof (long));
|
||||
printf("uns. long: \t%2d \n", (int) sizeof (unsigned long));
|
||||
|
||||
printf("long long: \t%2d \n", (int) sizeof (long long));
|
||||
printf("uns. long long: %2d \n", (int) sizeof (unsigned long long));
|
||||
|
||||
// Gleitpunkttypen
|
||||
printf("float: \t\t%2d\n", (int) sizeof (float));
|
||||
printf("double: \t%2d\n", (int) sizeof (double));
|
||||
printf("long double: \t%2d\n", (int) sizeof (long double));
|
||||
|
||||
|
||||
printf("\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
int main(){
|
||||
int i;
|
||||
|
||||
printf("\n");
|
||||
|
||||
i=12;
|
||||
while(i>=0){
|
||||
if (i==0){
|
||||
|
||||
printf("%d \n", i);
|
||||
}
|
||||
else {
|
||||
printf("%d, ", i);
|
||||
}
|
||||
i=i-2;
|
||||
}
|
||||
|
||||
i=-1;
|
||||
do{
|
||||
if (i==-13){
|
||||
printf("%d \n", i);
|
||||
}
|
||||
else {
|
||||
printf("%d, ", i);
|
||||
}
|
||||
i=i-2;
|
||||
}
|
||||
while(i>=-13);
|
||||
|
||||
i=0;
|
||||
while(i<=9){
|
||||
if (i==9){
|
||||
printf("%d \n", i*i);
|
||||
}
|
||||
else{
|
||||
printf("%d, ", i*i);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user