Introduction to Programming

Variables and Expressions


#include <stdio.h>

int main(int argc, char *argv[])
{
    int a, b, c;

    a = 5;
    b = a * 2;
    c = (b+2) / 3;

    printf("a = %d\n", a);
    printf("b = %d\n", b);
    printf("c = %d\n", c);

    return 0;
}

Next: if ... then

Previous: Hello World


Introduction to Programming

Home