
- C Programming Tutorial
- C - Home
- C - Overview
- C - Environment Setup
- C - Program Structure
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Constants
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - Loops
- C - Functions
- C - Scope Rules
- C - Arrays
- C - Pointers
- C - Strings
- C - Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Recursion
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming useful Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion
State the importance of C language and its general structure
C programming is a general-purpose, procedural, imperative computer programming language.
Importance of C Language
C is called as a robust language, which has so many built-in functions and operations, which can be used to write any complex program.
Generally, we use to call C as a middle level language. Because, the ‘C’ compiler combines the capabilities of an assembly language with the features of a high-level language. Therefore, it is best for writing both system software and business packages.
‘C’ Programs are efficient and fast.
C is highly portable, that is, ‘C’ programs written on one computer can be run on another with little (or) no modification.
‘C’ language is best for structured programming, where the user can think of a problem in terms of function modules (or) blocks.
It has the ability to extend itself.
It was named ‘C’ because it is an offspring of BCPL (Basic Combined Programming Language) which was popularly called ‘B’ language.
General form of a ‘C’ program
The general form of C program is as follows −
/* documentation section */ preprocessor directives global declaration main ( ){ local declaration executable statements } returntype function name (argument list){ local declaration executable statements }
Example
Following is the C program by using function with no arguments and with return value to perform addition −
#include<stdio.h> void main(){ //Syntax for addition (function has int because we are returning values for function// int sum(); int add; add = sum(); printf("Addition of two numbers is : %d",add); } int sum(){ //Declaring actual parameters// int a,b,add; //Reading User I/p// printf("Enter a,b :"); scanf("%d,%d",&a,&b); //Addition operation// add=a+b; //Returning value// return add; }
Output
When the above program is executed, it produces the following result −
Enter a,b :4,6 Addition of two numbers is : 10
- Related Articles
- State the difference between structure and union with suitable example in C language
- What is the ‘greenhouse effect’? State its importance for us.
- State the importance and features of cash books
- Structure declaration in C language
- Explain the accessing of structure variable in C language
- Structure of Human Language
- What is union of structure in C language?
- State the structure of iris.
- Explain top-down design and structure chart of function in C language
- General Data Link Layer Frame Structure
- Tort Law and its General Defenses
- Generation of Electrical Energy and its Importance
- State the difference between memcmp and memicmp functions in C language
- Business Leadership and Its Importance
- Project Documentation and Its Importance
