title: Is it possible to merge double variables with int variables in C++?
body: <p>I am trying to use the <strong>%</strong> modulo in a simple calculator which used the merge of <strong>double</strong> and <strong>int</strong> variable which is already declared in the code.
  I am using this way because by using Double variables with " modulo % " is not possible according to my knowledge.</p>
  
  <pre><code> #include &lt;iostream&gt;
      using namespace std;
      main()
      {
      double variable1, variable2;
      int variable3 = variable1, variable4 = variable2;
      beginning:
      system ("cls");
      cout &lt;&lt; "Enter the First Number" &lt;&lt; endl;
      cin &gt;&gt; variable1;
      cout &lt;&lt; "Enter the Second number" &lt;&lt; endl;
      cin &gt;&gt; variable2;
      cout &lt;&lt; "What do you want to use?" &lt;&lt; endl;
      cout &lt;&lt; " + Addition can be use " &lt;&lt; endl;
      cout &lt;&lt; " - Subtraction can be use " &lt;&lt; endl;
      cout &lt;&lt; " * Multiplication can be use " &lt;&lt; endl;
      cout &lt;&lt; " / Division can be use " &lt;&lt; endl;
      cout &lt;&lt; " % Modulo can be use " &lt;&lt; endl;
      char decision;
      cin &gt;&gt; decision;
      switch (decision)
      {
      case '+':
          cout &lt;&lt; variable1 &lt;&lt; "+" &lt;&lt; variable2 &lt;&lt; "=" &lt;&lt; (variable1 + variable2) &lt;&lt; endl;
      break;
      case '-':
          cout &lt;&lt; variable1 &lt;&lt; "-" &lt;&lt; variable2 &lt;&lt; "=" &lt;&lt; (variable1 - variable2) &lt;&lt; endl;
      break;
      case '*':
          cout &lt;&lt; variable1 &lt;&lt; "*" &lt;&lt; variable2 &lt;&lt; "=" &lt;&lt; (variable1 * variable2) &lt;&lt; endl;
      break;
      case '/':
      if (variable2 != 0)
          cout &lt;&lt; variable1 &lt;&lt; "/" &lt;&lt; variable2 &lt;&lt; "=" &lt;&lt; (variable1 / variable2) &lt;&lt; endl;
          else
              cout &lt;&lt; "You can't divide by zero" &lt;&lt; endl;
      break;
      case '%':
          cout &lt;&lt; variable1 &lt;&lt; "%" &lt;&lt; variable2 &lt;&lt; "=" &lt;&lt; (variable3 % variable4) &lt;&lt; endl;
      break;
      default:
      cout &lt;&lt; "You have entered incorrect data";
      }
      cout &lt;&lt; "Do you want to continue using the Calculator? (Y/N)" &lt;&lt; endl;
      char decision2;
      cin &gt;&gt; decision2;
      if (decision2 == 'y' || decision2 == 'Y')
      goto beginning;
  
  }
  </code></pre>