C Language Overview - ProgrammerTech
Language:

Search

C Language Overview

  • Share this:
C Language Overview

Introduction to C Language

C language will be the focus of our conversation today, and it is about one of the most powerful programming languages ​​on the scene since its inception until now, and it is one of the high-level programming languages, which is like Pascal language in terms of ease of use on the one hand and on the other hand One of the low-level languages ​​in terms of its ability to address the components of the device, and one of the reasons for the popularity of the C language is the spread of the UNIX operating system, which is the most important operating system for advanced computers, as this system was written in the C language.

The first appearance of the C language was in AT&T laboratories in 1972, and it was the beginning as a project supervised by Dennis Ritchie, who is considered the inventor of the C language using the Unix operating system and C language is originally an old language called BCPL and BCPL was developed by Martin Richards in 1967, which in turn was the B language, which was invented by Ken Thompson. The B language led to the development of the C language in the seventies, where Dennis Ritchie took from the B language its best instructions and changed many of its limitations. And he added many instructions to it and made it a programming language and called it the C language.

 

Uses of the C language

The C language has many uses, including:

  1. Programming and development of operating systems.
  2. Database systems programming.
  3. Development of applications, graphical interface, games and a lot of uses.

 

C language features

  1. Very few reserved words are used.
  2. The use of fixed data types with the ability to implicitly cast the data type.
  3. The C language supports the implementation of many arithmetic and logical operations and operations for controlling data at the bitwise operations.
  4. The ability to write code in more than one file, translate each file separately, and allow linking of translated files.
  5. The C language is a language rich in functions and provides the programmer with a large number of input and output functions, and mathematical and arithmetic functions.

 

Disadvantages of C language

  • The C language relies on the style of the interpreter (which translates the entire program at once) and then displays the list of errors, unlike the BASIC language, which relies on the style of the interpreter, which makes it easier for the user to correct errors with ease.
  • There are errors in C that the compiler cannot detect.

The general form of a program in C

#include<stdio.h>
main()
{
	//Program commands
}
  • The word #Include means to include any library called stdio inside the project and is used for input and output functions and the extension of this library is .h ((there is also an extension .c)).
  • The word main means main, and the parentheses are the parentheses of the function, ie the main function of the program begins with a parenthesis and ends with a parenthesis {}.

 

printf() function for printing

The printf() function is the basic function for printing text sentences in C language, which is an abbreviation of the term print formatted. The printf() function allows controlling the way text sentences are printed, or what is known as the formatting of text sentences, and the ability to print variable values ​​inside the text to be printed.

Example 1

#include<stdio.h>
main()
{
printf("hello world");
}

The word #Include means including the library called stdio inside the project and it is used for the input and output functions and the extension of this library is .h ((there is also an extension .c)). The word main means main, and the parentheses are the parentheses of the function, ie the main function of the program begins with a parenthesis and ends with a parenthesis {}. The printf function is for the print command, meaning print for me the text written in parentheses, and the semicolon must be included; at the end.

When you run the program and press the Run button, it will print

hello world

Example 2

#include<stdio.h>
main()
{
printf("hello world\n");
}

This example is the same as the previous example, but we wrote it \n that is, when executing the program, go down a new line before exiting the program.

Example 3

Type the word CS on the screen using C and then scroll down a line.

#include<stdio.h>
main()
{
printf("CS\n");
}

Example 4

Type the word Saja and the word Muhammad using a four-space separator with \t and execute the result on the screen.

#include<stdio.h>
main()
{
printf("Saja\tMuhammad\n");
}

We asked the program to print the name Saja, then leave 4 spaces using /t, then print the name Muhammad after it, and then go down a new line using \n and exit the program.

When you run the code, the result will be

Saja    Muhammad

Tags:
Saja Alsadig

Saja Alsadig

من السودان مبرمجة مواقع ويب و تطبيقات أندرويد اتقن لغات "html, css, php, js" بالإضافة للتعامل مع اندرويد ستوديو و بناء التطبيقات, مهتمة بمجال التقنية منذ الصغر و كان لدي شقف كبير للدخول بالجامعه بقسم البرمجة و دخلته في عام 2013 و تعلمت كل شيئ ضمن الجامعة و خارجها من التعليم الذاتي و اتمنى أن أكون عند حسن ظن الجميع و إيصال الأمانة لكم, اعمل حاليا في إدارة موقع جامعة السودان..