title: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
body: <p>I was solving a problem. The question goes like this: Jill &amp; Jung love lucky numbers. The lucky numbers is obviously 4 &amp; 7, if a decimal representation of positive numbers contains 4 &amp; 7, the positive integer is considered lucky. For example <code>444</code>, <code>474</code> and <code>7</code> are lucky, where <code>4773</code> and <code>89</code> are not lucky.</p>
  
  <p>Jill wanted to convert non-lucky integers to lucky integers, by discarding the non-lucky digits in an integer. For Example answer for number <code>767456</code> is <code>774</code>, answer for number <code>9974</code> is <code>74</code>, answer for <code>1775667</code> is <code>777</code>.</p>
  
  <p>Jill will give you two numbers <code>a</code> and a lucky number <code>b</code>. Find an <em>minimum positive integer</em> <code>c</code> (<code>c &gt; a</code>) that will contain a lucky integer 'b'.</p>
  
  <p>Input Format:</p>
  
  <p>Integer <code>t</code>: number of test cases. Follow two integers <code>a</code> and <code>b</code> (<code>1 &lt;= a</code>, <code>b &lt;= 100000</code>). <code>b</code> is always a lucky Integer.</p>
  
  <p>Output Format:</p>
  
  <p>print a minimum number <code>c</code> that contains the lucky number <code>b</code></p>
  
  <p>Sample Input</p>
  
  <pre><code>1
  47 74
  </code></pre>
  
  <p>Sample Output</p>
  
  <pre><code>74
  </code></pre>
  
  <p>I am just a beginner in C. I wrote the following code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;math.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main() {
      int r1, r2, c1, c2, d1, d2, a, b, c, d, n, x, i, flag = 0;
      scanf("%d", &amp;n);
      for (i = 0; i &lt; n; i++) {
          scanf("%d%d%d%d%d%d", &amp;r1, &amp;r2, &amp;c1, &amp;c2, &amp;d1, &amp;d2);
          for (a = 0; a &lt; 25; a++)
              for (b = 0; b &lt; 25; b++)
                  for (c = 0; c &lt; 25; c++)
                      for (d = 0; d &lt; 25; d++) {
                          if ((a + b == r1) &amp;&amp; (c + d == r2) &amp;&amp;
                              (a + c == c1) &amp;&amp; (b + d == c2) &amp;&amp;
                              (a + d == d1) &amp;&amp; (c + b == d2) &amp;&amp;
                              a &gt; 0 &amp;&amp; b &gt; 0 &amp;&amp; c &gt; 0 &amp;&amp; d &gt; 0) {
                              printf("YES\n");
                              break;        
                          } else
                              flag = 1;
                      }
          if (flag == 1)
              printf("NO\n");
      }
      return 0;   
  }
  </code></pre>
  
  <p>I got the following error. Please help me.</p>
  
  <pre><code>solution.cc: In function 'int main()':
  solution.cc:10:19: warning: ignoring return value of 'int scanf(const char*, ...)', 
                     declared with attribute warn_unused_result [-Wunused-result]
                 scanf("%d",&amp;n);
                 ^
  solution.cc:13:25: warning: ignoring return value of 'int scanf(const char*, ...)',
                     declared with attribute warn_unused_result [-Wunused-result]
                 scanf("%d%d",&amp;a,&amp;b);
                 ^
  </code></pre>