title: Attaching a fix integer to a string
body: <p>Im trying to find a way, so that when the user inputs 2 colors, the program automatically gives each an integer value of my choice.</p>
  
  <p>example:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  
  enum color {
      black = 0,
      brown = 1,
      red = 2,
      orange = 3,
      yellow = 4,
      green = 5,
      blue = 6,
      purple = 7,
      grey = 8,
      white = 9 
  } colors;
  
  int main(){
      int sum;
      char first, second;
      printf("enter the first 2 colors");
      scanf("%s %s", &amp;first, &amp;second);
      sum = first + second
      printf("%d", colors);
      getch();
      return 0;
  }
  </code></pre>