Articles

Uses of Various Statements in C

by Ravi Bhadauria ADMEC Multimedia Institute

C is a programming language which is simple and easy language. It is a language which was introduced in 1972. It is the very first language which uses the English language to program. If you are pursuing C courses in Delhi or any other place to learn this language then statement is a most common word, you hear while learning programming. So, to know that what this word is all about what kinds of it are available in C language, read the article till the end.

It may be considered as an instruction to the computer to instruct that what will be the action to be performed. For example, show to the screen or taking input. A program is made up of collection of the declaration. Basically, we can divide this term of C in 3 types which are given below. Let us have a look on each type in-depth.

Simple Statements

As its name suggested that these are the types which are very simple and used for assignment and declaration of variables.

Assignment is an example of simple one

A=5;

Compound Statements

It is created by combining two separate compenets in C language. A block or body of a function are the example of the such type. Anything which is written between the curly braces those are the example of this compound component.

Decision Making Statements

These declarations helps to make the decision. If or if-else helps in making the decision whether the declaration will execute or not.

Syntax of examples:

if (condition)

{

declaration

}

else

{

declaration

}

Selection Statements

When you give the multiple options to select, this type is used for that. Switch is a good example of selection type.

Syntax of examples:

switch (expression)

{

case value1:

code segment1;

break;

case value2:

code segment2;

break;

}

Iteration Statements

These types are executed repeatedly untill a specific condition become false. Example of iteration are for loop, while loop and do while loop.

Syntax of examples:

Do while loop

do {

declaration(s);

} while( condition );

For loop

for ( initialization; condition; increment ) {

declaration(s);

}

While loop

while(condition) {

declaration(s);

}

Jump Statements

This type is used to jump the control of the program from one type to another type. Example of jump types are break and continue.

Syntax of examples:

Go to

goto label;

..

.

label: declaration;

Break Statement

break();

Continue statement

continue();

I/O Statements

I/O are those which are used to take input and give output to the user.

Syntax of examples:

printf("declaration");

scanf(",&var)

So, this how we have reached towards the end of this article. We have covered all the essential concepts that you need to know about the declarations and thier types in C langugae. All the above mentioned types are commonly used in C language. Selection, iteration, decision making and jump these types are fall under a common category. Hope this article has explained the concept of clearly. The mentioned topic is very basic and common term in programming but still they are important because when your base is strong then your building of your career will be strong. Base will build up with the combination of several basic and easy terms.

You need to build a strong foundation to enhance your knowledge in C language, and for acquiring such knowledge and command joining an ideal C Training Institute in Delhi. ADMEC Multimedia Institute is one of the best training centers in Delhi which offers professional training in C language course by industry experts. Know more about our web development courses, just contact us at +91 9911-7823-50.


Sponsor Ads


About Ravi Bhadauria Advanced   ADMEC Multimedia Institute

104 connections, 0 recommendations, 300 honor points.
Joined APSense since, May 25th, 2015, From Delhi, India.

Created on Dec 6th 2018 02:54. Viewed 251 times.

Comments

No comment, be the first to comment.
Please sign in before you comment.