Switch statement in C and C++

Switch statement


In the previous section, I have discussed how to use conditional statement in C and C++ language where I showed only if-else statement. Now I shall show you another powerful keyword named switch statement to control program sequence in C and C++ 



How switch statement works

When you need to take a decision from multiple choices and select only one choice, you can use switch statement for that case. Say, you need to make a menu in your program. When a user fulfills a condition, he will get a result and when he fulfills another condition, he will find another result and so on. To handle this situation switch is your best friend. Switch statement works with case keyword. When a particular condition will be fulfill within switch, the corresponding case statement will be executed like making switch on or off in your electrical or electronics switch board.  

Tutorial on conditional statement in C and C++

conditional statement
In the previous sections, you have learnt about data type and the first program in C and C++ with visual studio. In this section, you will learn an important term which is necessary not only in C and C++ but also any other programming languages named conditional statement. It will help you to make the program so professional.

Data Type and Variable in C/C++


In the previous section, you've seen details about the first program in C/C++ programming language. Now I shall discuss an important topic in C/C++ programming named data type.

Data type basics
To work with computer and computer programming, a programmer must handle various information or data. This data may be either numeric or string. Before programming with C/C++ for any application, you must decide which kind of data you want to handle. C/C++ gives you four basic fundamental data types to handle this information.

Elaboration the First Program in C/C++


In the previous section, I have discussed how to download and install Visual Studio 2010. In this section, I'll elaborate the program line by line. So you will get a clear concept on every line of code and get the basic concept about any C/C++ source code. Let's try...............

Getting Started with C and C++

Getting started

Introduction

Welcome to this blog which is about  C/C++ programming language. Here I'll discuss this programming language from beginning to professional with Visual Studio 2010. Going step by step through this blog, you'll able to learn how to build professional software with this high-level language. So no more wait....but before starting, you should be familiar with the background of the C/C++ programming language.

First Program in C/C++

First Program in C/C++
Now it is time to journey to our favorite language C/C++ as we've leanned the fundamental about this language at the previous discussion and in this section, we will start coding in C and C++ language. It is better to start with printing something on the screen as a first program. Yes, we will start from beginning but before starting we should know the basic requirements to start C/C++ programming. Now, at first we'll know the basic requirements to start this interesting programming language.