samedi 7 novembre 2015

this program is almost finished , but I have a small qustion

When I execute the program and I enter C or F and complete the process , this is the image of execute

I want to hide the line in the red rectangle and this is the syntax:

#include <stdio.h>

int main (void){
float f,c;
char var;
int x;

while(var!='x'){
printf("x=Ende c=Umrechnung c->f f=Umrechnung f->c:");
scanf("%c",&var);
if(var=='c'){
    printf("Grad Celsius =");
    scanf("%f",&c);
    f=(c*1.8)+32;
    printf("%.2f Grad Celsius sind %.2f Grad Fahrenheit\n",c,f);
}
else if(var=='f'){
    printf("Grad Fahrenheit =");
    scanf("%f",&f);
    c=(f-32)/1.8;
    printf("%.2f Grad Fahrenheit sind %.2f Grad Celsius\n",f,c);
}
else if(var=='x'){
    printf("fertig !! chao\n");
}
else {
    printf("Ungiltige Umreechnungsart!!\n");
}
}
return 0;

}

Aucun commentaire:

Enregistrer un commentaire