Here are few very simple and basic C language programs with C programming examples that you will use to understand the basics very easily. Write a C programme to calculate area of a rectangle : #include<stdio.h> int main(){ Int l, b, area; printf(“Enter length and breadth of a rectangle \n”); scanf(“%d %d”, &l, &b); area = l *b; printf(“Area of rectangle is %d \n”, area); return 0; } Write a C program to calculate area of a circle : #include<stdio.h> int main(){ float r, area; printf(“Enter the radius of the...
In this post I will tell you the basic structure of C program with example in C programming in very simple words. Our First C program : # include<stdio.h> int main() { printf("Hello World"); return 0; } save te above program with file name "First.c" Note : Every C language file should be saved using .C extention name. Basic structure of a C program : All C programs have to follow a basic structure. The execution of a C program starts from the main() function. The C compiler starts execution from the main() function and executes each statement written inside the main() function line by line. Each instruction of a C program should be terminated by a semicolon ( ; ) i.e. every line of a C program ends with the semicolon ( ; ). 1. Every program execution starts from the main( ) function. 2. ...