Code: Alles auswählen
rueckgabe=scanf("%fsqrt(%f)",&faktor,&wurzel);
[...]
return(rueckgabe);
Tipp: Lies mal die Beschreibung von scanf durch: http://www.cplusplus.com/reference/cstdio/scanf/
Code: Alles auswählen
rueckgabe=scanf("%fsqrt(%f)",&faktor,&wurzel);
[...]
return(rueckgabe);
Code: Alles auswählen
float get_user_input(int Winkelfunktion, int Winkel){
float faktor;
float wurzel;
float rueckgabe;
if(Winkelfunktion==1){
printf("Was ist der Wert der Funktion cos(%i)\n",Winkel);
rueckgabe=scanf("%fsqrt(%f)",&faktor,&wurzel);
}
else{
printf("Was ist der Wert der Funktion sin(%i)\n",Winkel);
rueckgabe=scanf("%fsqrt(%f)",&faktor,&wurzel);
}
return(rueckgabe);
}
int scanf ( const char * format, ... );
Read formatted data from stdin
Reads data from stdin and stores them according to the parameter format into the locations pointed by the additional arguments.
Das Problem ist, dass du scanf nicht verstanden hast.es geht aber trotzdem nicht verdammt,auch wenn ich davor int schreibe,ich hab alles schon probiert
Code: Alles auswählen
faktor * Sqrt[wurzel]
Code: Alles auswählen
return faktor * sqrt(wurzel);