Playing with the C language

March 23, 2013
programming c-language

Points to remember while coding in C :

– put newline (\n) in your printf so as the output does not overlap with the terminal prompt. – keep clean tab spaces to make code reading easier. – put a getchar() to prevent the program from vanishing after execution (unlikely to happen if run from terminal).

Here’s a short program to recall the basics. :-)

#include
int main()
    {
        int age;
        printf("Please enter your age : ");
        scanf("%d", &age);
        if ( age >= 18 ) {
            printf ("You are a major!\n");
        }
        else if ( age < 18 && age > 12 ) {
            printf ("You are a minor!\n");
        }
        else {
            printf ("You are a kid!\n");
        }
        getchar();
        return 0;
    }

Another point to remember:

Difference between var1 and &var1 in C. – var1 refers to a declared variable – &var1 refers to a memory location

Functional Programming by Renghen

May 28, 2017
programming meetup mauritius-software-craftsmanship-community

braincheck() perl script

March 4, 2014
linux programming

Visual Studio 2013 virtual launch

November 19, 2013
windows programming user-groups-mauritius journal microsoft