0

Stuck on A code using structures 😞

HI guys ,hope you'r good. so i was trying out a code to calculate sum and difference between two complex number also multiply the first Complexe number with a float value and it didn't work any help ? here is the code === 》》》》 https://code.sololearn.com/cz5HA3FnIcL5/?ref=app

27th Feb 2019, 1:17 AM
Dynno
Dynno - avatar
4 Respuestas
+ 2
In all the scanf("-%f\n ",.... Remove the - at the beginning of the string: scanf("%f\n ".... That - means: "read input and if is - continue reading next chsr. If it isn't - stop reading. So if you input -6, the number 6 is read and stored in the variable. But if you input 6, scanf ends without assigning any value to the variable. The same is valid for all non-whitespace character except %
27th Feb 2019, 2:29 AM
unChabon
unChabon - avatar
+ 2
Sure there are things "like this" You'll find out eventually... :) Choose a C library reference (i.e. cplusplus.com) and study a function from libraries a day... It's a nice addition to C tutorial here... Good luck!!
27th Feb 2019, 8:48 AM
unChabon
unChabon - avatar
+ 1
diego Code Oh i see i never knew this "-" in the scanf exist i guess there is a lot more thank you i appreciate it 😁😊 um also is there any other thing in C like this ?
27th Feb 2019, 7:52 AM
Dynno
Dynno - avatar
+ 1
diego Code thank you !
27th Feb 2019, 8:53 AM
Dynno
Dynno - avatar