Beispiel #1
0
int main()
{
    int x = 5, y =2;
    printf("%d power %d is %ld\n", x, y, MyPower(x,y));
    printf("%d factorial is %ld\n", x, MyFactorial(x));
    printf("%d is %0.2f%% of %d\n", y, MyPercentage(y, x), x);
    return 0;
}
Beispiel #2
0
void main(void)
{
    volatile uint32_t i;

    WDTCTL = WDTPW | WDTHOLD;           // Stop watchdog timer

    // The following code toggles P1.0 port
    P1DIR |= BIT0;                      // Configure P1.0 as output
    MyFactorial();
}