Skip to main content

Posts

Showing posts with the label history of c language

Keywords in C

  Keywords in C A keyword is a  reserved word . You cannot use it as a variable name, constant name, etc. There are only 32 reserved words (keywords) in the C language. A list of 32 keywords in the c language is given below: auto break case char const continue default do double else enum extern float for goto if int long register return short signed sizeof static struct switch typedef union unsigned void volatile while We will learn about all the C language keywords later.

Data Types in C

  Data Types in C A data type specifies the type of data that a variable can store such as integer, floating, character, etc. There are the following data types in C language. Types Data Types Basic Data Type int, char, float, double Derived Data Type array, pointer, structure, union Enumeration Data Type enum Void Data Type void Basic Data Types The basic data types are integer-based and floating-point based. C language supports both signed and unsigned literals. The memory size of the basic data types may change according to 32 or 64-bit operating system. Let's see the basic data types. Its size is given  according to 32-bit architecture . Data Types Memory Size Range char 1 byte −128 to 127 signed char 1 byte −128 to 127 unsigned char 1 byte 0 to 255 short 2 byte −32,768 to 32,767 signed short ...

Variables in C language

  Variables in C A  variable  is a name of the memory location. It is used to store data. Its value can be changed, and it can be reused many times. It is a way to represent memory location through symbol so that it can be easily identified. Let's see the syntax to declare a variable:   1.       type variable_list;   The example of declaring the variable is given below: 1        int  a;   2.       float  b;   3.       char  c;   Here, a, b, c are variables. The int, float, char are the data types. We can also provide values while declaring the variables as given below:   1.       int  a=10,b=20; //declaring 2 variable of integer type    2.       float  f=20.8;   3.   ...

Basic C Language Notes

  First C Program Before starting the abcd of C language, you need to learn how to write, compile and run the first c program. To write the first c program, open the C console and write the following code: 1.       #include <stdio.h>      2.      int  main() {    { 3.      printf( "Hello C Language" );     4.      return  0;    5.      }   #include <stdio.h>  includes the  standard input output  library functions. The printf() function is defined in stdio.h . int main()  The  main() function is the entry point of every program  in c language. Compilation process in c What is a compilation? The compilation is a process of converting the source code into object code. It is done with the help of the compiler. The compiler che...

Features of C Language

  Features of C Language C is the widely used language. It provides many  features  that are given below. Simple Machine Independent or Portable Mid-level programming language structured programming language Rich Library Memory Management Fast Speed Pointers Recursion Extensible 1) Simple C is a simple language in the sense that it provides a  structured approach  (to break the problem into parts),  the rich set of library functions ,  data types , etc. 2) Machine Independent or Portable Unlike assembly language, c programs  can be executed on different machines  with some machine specific changes. Therefore, C is a machine independent language. 3) Mid-level programming language Although, C is  intended to do low-level programming . It is used to develop system applications such as kernel, driver, etc. It  also supports the features of a high-level language . That is why it is known as mid-level languag...