This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

printf

Hi,

I am trying to run my first C program on Keil...it works perfectly until I insert a printf statement...am i missing something?

#include <reg52.h>
#include <stdio.h>

void main(void)
{
        unsigned int i;

        unsigned int ans = 0;

        for (i =0; i< 5; i++)
        {
                ans += 2;
        }

        printf("The answer is: " + ans);
}

0