C++ Looping and scanf validate alphabet, capital alphabet and numbers
<p>I have some problem with my code, it appears after I compile and run the code it will output twice and also wrong output. </p>

<p>My task is to repeatedly input numbers/alphabet/capital and output the results accordingly. As for the while loop, I believe I have to put <code>while(1)</code>.</p>

<pre><code>#include &lt;stdio.h&gt;
int main()
{
    char c;
    int num;

    printf("\nEnter a character: ");
    scanf("%c", &amp;c);

    if ((c &gt;= 'a' &amp;&amp; c &lt;= 'z')) 
        printf("%c\nIt is an alphabet.", c);

    if ((c &gt;= 'A' &amp;&amp; c &lt;= 'Z'))
        printf("%c\n It is a capital alphabet.", c);

    if (c &lt;= '1' ||c &gt;= '1') 
        printf("\nIt is a numeric");

    else 
        printf("error");

 return 0;
}
</code></pre>