Day 1
Day 1
Day 1
Introduction
• C is developed by Dennis Ritchie
• C is a structured programming language
• C supports functions that enables easy
maintainability of code, by breaking large file
into smaller modules
• Comments in C provides easy readability
• C is a powerful language
Program structure
A sample C Program
#include<stdio.h>
int main()
{
--other statements
}
Header files
• The files that are specified in the include
section is called as header file
• These are precompiled files that has some
functions defined in them
• We can call those functions in our program by
supplying parameters
• Header file is given an extension .h
• C Source file is given an extension .c
Main function
• This is the entry point of a program
• When a file is executed, the start point is the
main function
• From main function the flow goes as per the
programmers choice.
• There may or may not be other functions
written by user in a program
• Main function is compulsory for any c program
Writing the first program
#include<stdio.h>
int main()
{
printf(“Hello”);
return 0;
}