Computer for SEE and NEB

It is a complete SEE and NEB solution for computer science. It includes Computer Fundamentals, Database (SQL), Programming in C QBASIC, CSS, JavaScript, and PHP for beginners.

Post Top Ad

Your Ad Spot

Sunday, June 26, 2022

Introduction to 'C' programming language for SEE and NEB

 

Introduction to 'C' programming language for SEE and NEB






Introduction:

In today's world, computer programming is an essential skill that opens up numerous opportunities for individuals in the field of technology. 'C' programming language is one of the most widely used programming languages, which forms the foundation of many popular programming languages like Java and Python. It is a procedural programming language that has been in use for over four decades. In this article, we will introduce the basics of 'C' programming language for students of SEE and NEB.



What is 'C' Programming Language?

'C' programming language is a high-level programming language that was developed by Dennis Ritchie at Bell Labs in 1972. It is a procedural programming language, which means that it follows a step-by-step approach to solving problems. 'C' programming language is popular among developers due to its portability, speed, and efficiency. It is widely used for developing operating systems, system software, embedded systems, and game development.

 

Facts about C

  • C was invented to write an operating system called UNIX.
  • C is a successor of B language which was introduced around the early 1970s.
  • The UNIX OS was completely developed  in C.
  •  â€˜C’ is the most widely used and popular System Programming Language in today’s programming field.
  • Most of the software has been developed by using ‘C’
  • Today's most popular Linux OS and RDBMS MySQL have been written in C.

 

Features of C:

  1. It is simple to learn because it has a small set of commands.
  2. It is a structured programming language.
  3. Programs written in C language is machine independent.
  4. Modular programming is possible.
  5. It is a bridge between high-level and low-level language.
  6. It is much faster than other languages.
  7. It supports a different set of data types and data declarations.
  8. It provides several built-in functions to perform several tasks.
  9. It is a powerful high-level language that allows developing different types of commercial as well as hardware-related programming.
  10. The programs written in ‘C’ are independent.

 

Advantages and disadvantages of C language:

Advantages:

  • It is machine independent.
  • It is portable programming language.
  • It is mother of all modern programming language.
  • Its compiler is easily available.
  • It has the capability of both high level and low level programming language.
  • It is fast for executing.

 

Disadvantages:

  •   There is no runtime checking.
  • On large program, it is difficult to fix errors.
  • Object oriented programming is not possible.
  • It is complex and hard for the beginners.

 

Structure of C program

Before understanding the structure of 'C' program you must know the following points:

  • 'C' is a case sensitive language, it means all the keywords must be written in lowercase.
  • Keywords can't be used as variable or function name.
  • Every instruction should be end with (;) sign.
  • Preprocessor directives should be there in the beginning.
  • Function main() is must for a program.

While writing a program in 'C' we have to follow the following steps:

i.         Define preprocessor directives (include header files according to prototype functions, standard I/O library function to be used)

ii.        Open function main ( ).

iii.       Assign data type and variables.

iv.       Define the body of the function.

v.        End the function main ( ).

Example:

1: /* Example of 'C' programming*/

2: #include<stdio.h>

3: void main()

4: {

5: int a=10, b=15, c;

6: printf("Welcome to 'C' world \n");

7: c=a+b;

8: printf("The sum of %d and %d is %d",a,b,c);

9: }

 

Note: Don't use colon sing and line number while writing the program in C.

 

In above example:

First Line:  /* Example of 'C' programming*/

It is a comment and non-executable.

 

Second Line: #include<stdio.h>

It is a preprocessor directive. The preprocessor process the 'C' program before the compiler. stdio.h is a header file which consists of standard I/O functions. More than one header file can be used in a program.

 

Third Line:  void main()

It indicated the beginning of the program. The compilation of the ‘C’ program starts from main () function.

 

Fourth Line: {

This symbol indicates the beginning of main () function.

Fifth Line: int a=10, b=15, c;

It is used for declaration of variables and data types.

 

Sixth, Seventh and Eighth Line:

These lines are the body of the programs.

 

Ninth Line: }

It indicates the end of main () function.

To Run the program:

1.     Press ALT+F9 to compile the program.

2.     Press CTRL + F9 to RUN the program.

3.     Press ALT + F5 to View the output.

 


Conclusion:

In conclusion, 'C' programming language is a popular programming language that has been in use for over four decades. It is a procedural programming language that is widely used in operating systems, system software, and embedded systems. 'C' programming language is easy to learn, and its syntax is simple and easy to understand. As students of SEE and NEB, understanding the basics of 'C' programming language can open up opportunities in the field of technology and help them develop essential programming skills.


You can also Read:


No comments:

Post a Comment

Post Top Ad

Your Ad Spot

Pages