C Tutorial

C-Statements

Let’s understand the statements using WWH theory.

What is a statement?

As per dictionary a statement is “something that you say or write, especially formally”.
Ex. The sky is blue., Water boils at 100°C. etc. These are some statements.

But In the Computer Programming Language, a statement is a complete instruction that provides some information to the compiler or tells the computer to perform an action.

Why is it required?

We know that Computer is a hardware machine and it need instructions (in binary form) to perform any task. So, to get these computer instructions, statements are written in Computer Programming Language. The compiler converts these Programming Language statements into computer instructions. Which are later execute on hardware machine.

How to write a statement in C Language?

In C language, we should write the statements as per C language rules.
Ex. int a; // It will declare a variable statement.
a; // It is an invalid statement.

There are basically 2 types of statements.

  1. Declarative statements: These statements just provide some information to the compiler. These are not converted to computer instructions. These are also call helper instructions because they help compiler to generates computer instructions.
    Ex. int a; // This is a declarative statement. It tells the compiler that “a” is a variable of data type “int”. It will not execute on machine.
  2. Executive statements: These statements are converted to computer instructions which later executes on machine.
    Ex. a = a+10; // This is an executive statement, which adds 10 to the value present in variable “a”. It will execute on machine.

We will learn all the variables, data types in next posts. So, please keep reading …!😊

Leave a Reply

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

Related Posts

Back To Top