title: Is there a way to use scanf with the "if" and "else" statements?
body: <p>I have to create and call a function from main. Then I have to call scanf to read two integers and print out the bigger one. Then I have to do another scanf, but this time with doubles instead of integers.</p>
  
  <pre><code>int main()
  {
     int x, y;
     scanf("%d%d", &amp;x, &amp;y);
  
     if (x &gt; y)
     {
        printf("%d", x);
     }
  
     scanf("%lf%lf", &amp;w, &amp;z);
  
     if ( w &gt; z)
     {
        printf("%f", w);
     }
  
     return 0;
  }
  </code></pre>
  
  <p>I'm not sure if I did this right and how would I check the return value to see that the scanf worked? Thanks.</p>