title: C code wont execute
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;stdlib.h&gt;
  
  
   void encrypting(char cipher[25], int shift, int num)
  { int i;
   for ( i=0; i &lt; num; i++)
  {
      if (cipher[i] &gt;= 'A' &amp;&amp; cipher[i] &lt;= 'Z')
      {
          cipher[i] = (char)(((cipher[i] + shift - 'A' + 26) % 26) + 'A');
      }
      else if (cipher[i] &gt;= 'a' &amp;&amp; cipher[i] &lt;= 'z')
      {
          cipher[i] = (char)(((cipher[i] + shift - 'a' + 26) % 26) + 'a');
      }
  }
  }
  
   void decrypting(char cipher[25], int shift, int num)
  { inti;
   for ( i=0; i &lt; num; i++)
  {
      if (cipher[i] &gt;= 'A' &amp;&amp; cipher[i] &lt;= 'Z')
      {
          cipher[i] = (char)(((cipher[i] - shift - 'A' + 26) % 26) + 'A');
      }
      else if (cipher[i] &gt;= 'a' &amp;&amp; cipher[i] &lt;= 'z')
      {
          cipher[i] = (char)(((cipher[i] - shift - 'a' + 26) % 26) + 'a');
      }
      }
  }
  
  int main ()
  {
  char text[10];
  static const char encrypt[] = &quot;2&quot;;
  static const char decrypt[] = &quot;1&quot;;
  int shift;
  char cipher[25];
  int result1;
  int result2;
  int num;
  int i;
  
  
  
  printf( &quot;Enter operation: encrypt or decrypt/n&quot; );
  printf( &quot;Press 1 to Encrypt or 2 to Decrypt&quot; );
  scanf(&quot;%c&quot;,&amp;text) ;
  printf( &quot;Enter shift key&quot; );
  scanf(&quot;%d&quot;,&amp;shift) ;
  printf(&quot;Enter text to encrypt/decrypt&quot;) ;
  fflush(stdin);
  scanf( &quot;%c&quot;,&amp;cipher) ;
  
  num = strlen (cipher);
  
  result1 = strcmp (text, encrypt);
  result2 = strcmp (text, decrypt);
  
  if(result1 == 0)
  {
      decrypting(cipher, shift, num);
  }
  else{exit(0);}
  
  if(result2 == 0)
  {
      encrypting(cipher, shift, num);
  }
  else{exit(0);}
  
  printf(&quot;Result&quot;);
  printf(&quot;%d&quot;,cipher);
  }
  </code></pre>
  <p>This my code for a simple program that encypts or decrypts a string based on user choice.</p>
  <p>The code produce this error when i try to compile, could anyone explain whats the problem.</p>
  <blockquote>
  <p>C:\Users\Adam\Documents\Ceaser Cipher Dr X\First try.c||In function 'main':|</p>
  <p>C:\Users\Adam\Documents\Ceaser Cipher Dr X\First try.c|65|error: too few arguments to function 'decrypting'|</p>
  <p>C:\Users\Adam\Documents\Ceaser Cipher Dr X\First try.c|21|note: declared here|</p>
  <p>C:\Users\Adam\Documents\Ceaser Cipher Dr X\First try.c|71|error: too few arguments to function 'encrypting'|</p>
  <p>C:\Users\Adam\Documents\Ceaser Cipher Dr X\First try.c|6|note: declared here|</p>
  <p>||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|</p>
  </blockquote>
  <p>Edit: I've corrected my codes but now after the user inputs the string for cipher, the program will automatically terminates.</p>