Coding Global Background
Coding Global

im not sure what EXACTLY is the isssue

0 Nachrichten
1 Mitglieder
Erstellt 3 hours ago
Aktualisiert 38 minutes ago
In Discord öffnen
D
Comrade
Verified
here's what's relevant
code and output when running it

// make Fahrenheit
double c_to_f(int c){
 double f = (c * 1.8)+32;
 return f;
}



int main(){
 
 int cont = 0;
 int valIn;
 double outVal;
 char outType = ' ';
 char inType = ' ';


 while(inType != 'F' && inType != 'C' && inType != 'K' ){
 printf("Enter the input type you want | F , C, K \n");
 scanf("%s",&inType);
 }

 while(outType != 'F' && outType != 'C' && outType != 'K' ){ 
  printf("Enter the result type you want | F , C, K \n");
  scanf("%s",&outType);
 }

 printf("Enter a value in Celcius \n");
 scanf("%d", &valIn);
 
 outVal = c_to_f(valIn);
 printf("%d degrees Celcius is %d degrees %s \n", valIn, outVal, outType); // Appears to be the Problematic line
 
 
 printf("Continue? | 0 = no |anything else = yes |");
 
 scanf("%d",&cont);
 if(cont != 0){
    main();
 }  
 else{
    printf("%d", cont);
 }


 return 0;
}
im not sure what EXACTLY is the isssue

Antworten (6)