c - Loop while double not equal character? -


I'm not sure how to execute it ...

  double fahrenheit; Fahrenheit = 0; While (Fahrenheit! = "Q")  

I'm going to use scanf to get the value of Fahrenheit. Fahrenheit is double and Q is a character, so obviously it is not really like ... Can anyone tell me how it works?


This is for me, but I'm really in the early stages of learning about C or just programming in general. This is a simple practice in our book and I have not yet learned all those things, in fact, if they are input q, nothing happens. If they input anything but q, what happens to something like 1 + 1 = 2 kind of simple formula for me is absolutely fair for me?

scanf () shown below 0 when you pass the character When you enter q , the loop will expire

  double fahrenheit; While (scanf ("% lf", & amp; fahrenheit) == 1) {// your stuff}  

Other

  1. Read in Input < Input q
  2. to check if code> fgets ()
  3. using strcmp () q , then use strtod () to change the string again and assign that value to that variable.

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -