The C Programming Language Structure with C Language data types

The C Programming Language Structure with C Language data types

The C Programming Language Structure with C Language data types:

Programming is an art because of its creativity and versatility. A c programming language allows us to think about minimum program structures in order that we will take it as a reference in future topics.

C Language Hello World Example:

  • Pre-processor Commands
  • Functions
  • Variables
  • Comments
  • Statements & Expressions

Print the words “Hello World”:

Explain above program:

  1. The line of program #include can be a preprocessor command, which asks the C compiler to add the stdio.h file before moving on to the compile.
  2. Line int main () is that the main function where program execution begins.
  3. Next to main () line. This is the basic function where program execution begins.
  4. Line /*…*/ ignored by the compiler and it’s been put to feature additional comments in so such lines are called comments within the program.
  5. printf(..) is another function available in C that causes the message Hello, World! displayed on the screen.
  6. Last line return 0; because program terminates main () function and returns 0.

Comments:

Comments are like helping text in your C program and that they are ignored by the compiler. they begin with /* and terminates with the characters */ as shown below:

/* My first comment with codeboks.com*/

Whitespace in C Program:

The whitespace is the turn used in C to describe spaces, tabs, new posts and comments.

Whitespace separates one a part of a press release from another and enables the compiler to spot where one element during a statement, like int, ends and therefore the next element begins. Therefore, within the following example:

Int name;

There must be at least one white character between int and age to be ready to distinguish the compilers. In the opposite direction, inside the following example:

Sum = 4+3;

No whitespace characters are necessary between sum and =, or between = and a couple of, although you’re liberal to include some if wish for readability purpose.

C Language data types:

No.TypesStorage SizeValue Range
1char1 byte-128 to 127 or 0 to 255
2Unsigned char1 byte0 to 255
3Signed char1 byte-128 to 127
4Int2 or 4 byte-32,768 to 32,767 or -2,147,483,648 to 2,147,483,647
5unsigned int2 or 4 byte0 to 65,535 or 0 to 4,294,967,295
6Short2 byte-32,768 to 32,767
7unsigned short2 byte0 to 65,535
8Long4 byte-2,147,483,648 to 2,147,483,647
9unsigned long4 byte0 to 4,294,967,295
10float4 byte1.2E-38 to 3.4E+38
11double8 byte2.3E-308 to 1.7E+308
12long double10 byte3.4E-4932 to 1.1E+4932

Also: Basic Concepts of Programming Languages C++ Programming Examples

C++ Programs Examples with Output:

No.C++ Projects for beginners with Source Code
1Write a C++ program to check triangle by entering 3 angles
2Write a C++ program that asks for the number of units sold and computes the total cost of the purchase.
3Write a program that asks the user to enter a number of seconds.
4Write a C++ program that will ask user to enter two integral numbers. The numbers should be swapped without using any third variable.
5Write a C++ program which takes the price of bakery items ranging from 0-999

More C++ Programs Examples 

C# Sample Code:

No.C# Projects with source code
1Implement bubble sort in C# the value of array given by the users
2Write a C# program of throwing an exception when dividing by zero condition occurs
3Create a Simple Calculator in C# Windows form Application with Source Code
4C# windows form application projects with source code
5C# Program that read array display the smallest integer and sort the array in ascending order by using Array.Sort method.

More C# Programs Examples… 

Hi, I am M.A Siddiqui. I'm a Computer Science Student, In this website, I'm teaching you Multiple languages and provides Projects and other Subjects Notes.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *