Friday, 4 November 2016

Basics of C "Alphabets"

Basics of C "Alphabets"
Topics covered for the day :
Intorduction on LikeCProgramming tutours
Importance of C porgamming
Introduction to C Programming
Alphabets of C
Tokens
Identifiers
Constant (Integer Only)
Few simple programming snippets
Programming snippets
/* 1. Happy path : Successful execution of program */
void main()
{
puts ("Welcome to our C programming classes");
}

/* 2. Pre-processor usage : #include <stdio.h> */
#include <stdio.h>
void main()
{
printf ("Welcome to our C programming classes");
}

/* 3. Printf without Preprocessor
Output : Compilation error*/
void main()
{
printf ("Welcome to our C programming classes");
}

/* 4. Importance of " ; " */
/* Output : Compilation Error */
#include <stdio.h>
void main()
{
printf ("Welcome to our C programming classes")
}

/* 5. Chnage in return type */
/* Output : Successful execution of program */
#include <stdio.h>
int main()
{
printf ("Welcome to our C programming classes");
}

/* 5. Difference in return type */
/* Output : Successful execution of program, BUT with warnings */
#include <stdio.h>
void main()
{
printf ("Welcome to our C programming classes");
return 10;
}

/* 6. White spaces after double quotes */
/* Output : Successful execution of program */
#include <stdio.h>
void main()
{
printf ("Welcome to our C programming classes"
);
}

/* 7. White spaces with in double quotes */
/* Output : Compilation error */
#include <stdio.h>
void main()
{
printf ("Welcome to our C
programming classes");
}


/* 8. White spaces with in double quotes */
/* Output : Compilation error */
#include <stdio.h>
void main()
{
printf ("Welcome to our C
programming classes");
}

No comments:

Post a Comment