C++ tutorial, C++ programs, C++ Exercises, C++ Example Programs

Friday, November 4, 2011

Program Temperature Conversion Algorithm Flowchart

Q: Write a C++ program To Convert Fahrenheit Temperature into Centigrade

Today, we will discuss a Program Temperature Conversion Algorithm Flowchart. This is a Three in One package for new C++ programmers for learning How To Program in C++. Let us see the algorithm first:


Algorithm: Temperature Conversion


This algorithm inputs a temperature in Fahrenheit and converts into centigrade.

1. Start
2. Input Temperature in Fahrenheit in F variable.
3. Calculate Centigrade C = (F-32) x 5.0 / 9.0   
4. Show temperature in centigrade
5. Stop


Picture of Temperature Conversion C++ Program With Sample Run Output

Image: Program Temperature Conversion Algorithm Flowchart

Program Temperature Conversion Algorithm Flowchart (Program code)

Flowchart of C++ Temperature Conversion Program

Image: ( Flow chart )Program Temperature Conversion Algorithm Flowchart

( Flow chart ) Program Temperature Conversion Algorithm Flowchart

Source code for DevC++ IDE/ C++ Compiler

#include<iostream> 

using namespace std;

int main()

{   

float c,f;

cout<< "Enter Temperature in F:";
cin>>f;
c=(f-32)*5.0/9.0;

cout<<"Temperature in centigrade="<<c;
return 0;
} 

Output

Enter Temperature in F:98.6
Temperature in centigrade=37
--------------------------------
Process exited after 16.38 seconds with return value 0
Press any key to continue . . .

C++ Source code Program Temperature Conversion

Sponsored Links



// include iostream.h header file

#include<iostream.h> 

// start of main function

int main()

{       // start of main function body
        // declare 2 float variables c and f

float c,f;

//show message to user to enter temperature in F
cout<< "Enter Temperature in F:";

//input temperature in F
cin>>f;

//calculate temperature in centi grade
c=(f-32)*5.0/9.0;

//show answer in centigrade
cout<<"Temperature in centigrade="<<c;

// return 0 - successful execution

return 0;
}     // end of main function body


So, beginners in C++ Programming, we have discussed how to design an algorithm, flow chart and write actual program code. Dear learners of C++, this is the end of this C++ tutorial on Program Temperature Conversion Algorithm Flowchart.

Simple Temperature Conversion program without comments C++ on Easyway C++

 //Turbo C++ 3.0 IDE Easyway C++ Programs
#include<iostream.h>
#include<conio.h>
void main()
{

float c,f;

cout<< "Enter Temperature in F:";

cin>>f;

c=(f-32)*5.0/9.0;

cout<<"Temperature in centigrade="<<c;

getche();
}


program-temperature-conversion-algorithm-flowchart-C-Plus-plus


Further Suggested Readings: After Download Free Turbo C++ Ver 3.0 IDE!

Basic Structure of a C++ Program

C++ Program Development Cycle

How To Write, Compile and Run Your First C++ Program

How To Start Turbo C++ IDE

How To Install Turbo C++ 3.0 - IDE

Features of C++ Programming Language

Brief History of C++

Flowcharts in Computer Programming

The Role of Algorithms in Programming

How To Start Computer Programming

What is a Computer Program

- See more at: http://easycppprogramming.blogspot.com
 < /b>

Share:

Program Average Algorithm and Flowchart

Q: Write a program to input three numbers, and calculate and show their average

Today, we will discuss a simple C++ program that inputs three numbers and calculates and shows average of these numbers.

Algorithm: Average

Calculates average of three numbers.

1. Start
2. Include iostream.h [Note: this step is only for C++].
3. Declare 5 float variables n1,n2,n3, total and avergae.
4. Display a message (prompt) on screen "Enter First Number:"
5. Input n1.
6. Display a message (prompt) on screen "Enter Second Number:"
7. Input n2.
7. Display a message (prompt) on screen "Enter Third Number:"
8. Input n3.
9. Calculate total= n1 + n2 + n3
10. Calculate average = total / 3
11. Show a message "Average=" and value stored in average variable.
12. Stop


C++ Program To Calculate Average of Three Numbers Input by User at Run time
C++ Program To Calculate Average of Three Numbers Input by User at Run time

Simple C++ Program To Calculate Average of Three Numbers With Algorithm and Flow chart
Simple C++ Program To Calculate Average of Three Numbers With Algorithm and Flow chart 

Source code for Dev C++ & other Modern C++ Compilers / IDEs

#include<iostream>
using namespace std;
int main()

{

float n1,n2,n3,total,average;
cout << "Enter First Number:";
cin>>n1;
cout<<"Enter Second Number:";
cin>>n2;
cout<<"Enter Third Number:";
cin>>n3;

total=n1+n2+n3;
average=total/3;

cout<<"average="<<average;
return 0;

}

A Sample Output of Program

Enter First Number:10
Enter Second Number:20
Enter Third Number:30
average=20
--------------------------------
Process exited after 26.5 seconds with return value 0
Press any key to continue . . .

Program Source Code for Turbo C++ 3.0: C++ Program To Calculate Average of Three Numbers With Algorithm and Flow chart

#include<iostream.h>

int main()

{

float n1,n2,n3,total,average;

cout << "Enter First Number:";

cin>>n1;

cout<<"Enter Second Number:";

cin>>n2;

cout<<"Enter Third Number:";

cin>>n3;

total=n1+n2+n3;

average=total/3;

cout<<"average="<<average;

return 0;

}

Share:

Thursday, October 13, 2011

Download Pre-installed Turbo C++ 3.0 IDE Free

Download Pre-installed Turbo C++ 3.0 IDE Free
Download Pre-installed Turbo C++ 3.0 IDE Free
Download Pre-installed Turbo C++ 3.0 IDE Free
Wlcome to New C++ Programmers,  Download Preinstalled Turbo C++ 3.0 IDE Free From MediaFire and Alternate download link from 4Shared and start computer programming now!
Here is a free Turbo C++ download link for the novice or students learning introduction to programming. Turbo C++ Version 3.0 is an easy to use IDE for developing, compiling and executing C++ programs.

When you intend to learn how to program in any computer programming language, definitely, you need a book and an IDE where you start writing computer programs. Turbo C++ IDE is a simple and Free to download IDE to write C language or C++ programs easily, and compile / Execute these programs efficiently. Here is a download link in this blog post as follows.

Easy Steps To Download Preinstalled Turbo C++ 3.0 IDE Free

Step1: Download Turbo C++ 3.0 (Download Link is given at bottom of this page)
Step2: Copy Downloaded file to 'C Drive'
           Right Click on Downloaded file
           Click on 'Extract Here'
 Download Pre-installed Turbo C++ 3.0 IDE Free
Step3: You will see a folder named 'TC' on         C drive .
Download Pre-installed Turbo C++ 3.0 IDE Free RAR File 4shared.com
Step4: Double click on TC folder to open it.
Step5: Here you will find a Shortcut to TC.EXE. Copy this shortcut file to desktop.
Download Pre-installed Turbo C++ 3.0 IDE Free and make shortcut

Step6: Double click on this shortcut, the Turbo C++ Integrated Development Environment will open. 
Step7: Here you can write C++ or C language programs, compile and run to check the output.
Picture: Download Pre-installed Turbo C++ 3.0 IDE Free

Step8: You can type, compile and run C++ programs, easily in Turbo C++ 3.0 IDE.

Download Free Turbo C++ Editor from this link Download Free Turbo C++ Ver 3.0 IDE

 

Alternative MEDIAFIRE download Link

Mirror Download Free Turbo C++ Editor from this link Download Free Turbo C++ Ver 3.0 IDE from MediaFire

Download Pre-installed Turbo C++ 3.0 IDE Free from 4shared.com easily and totally free of charge version.
After downloading one of the most popular C Plus Plus Free IDE for beginner programmers and C++ students, you can start Learn Computer Programming in C++ easily. Just double click on the C++ shortcut on desktop and enjoy writing your first C++ program.

Further Suggested Readings: After Download Free Turbo C++ Ver 3.0 IDE!

Basic Structure of a C++ Program

C++ Program Development Cycle

How To Write, Compile and Run Your First C++ Program

How To Start Turbo C++ IDE

How To Install Turbo C++ 3.0 - IDE

Features of C++ Programming Language

Brief History of C++

Flowcharts in Computer Programming

The Role of Algorithms in Programming

How To Start Computer Programming
What is a Computer Program
- See more at: http://easycppprogramming.blogspot.com
Share:

Friday, August 5, 2011

C++ Program Logic Building-Program 1


Let us start learning C++ by understanding an example program. This program is used to
1) input two whole numbers,
2) to calculate their total and
3) to show this total on screen.
The program code ( set of instructions ) is given below in a table and shown in colors according to C++ coding conventions in the figure above:

So let's start with program planning. First we write an algorithm of the given programming problem. This will make writing the program easier:



Q: Write a program to input two whole numbers, calculate and show their total.


  Algorithm: Total of two whole numbers
  1. Start
  2. Include iostream.h
  3. Declare three integer variables a,b and c.
  4. Display a message (prompt) on screen "Enter First Number:"
  5. Input a.
  6. Display a message (prompt) on screen "Enter Second Number:"
  7. Input b.
  8. Calculate c=a+b.
  9. Show a message "toatl=" and value stored in c variable.
  10. Stop


Now here we convert this algorithm into a C++ program.



#include<iostream.h> // include iostream.h header file
int main() // start of main function (that will return an integer value)
{ // start of main function body
int a,b,c; // declare 3 integer variables a,b,c
cout << "Enter First Number:"; //show message to user to enter first number
cin>>a; //input first number
cout<<"Enter Second Number:"; // show message for second number
cin>>b; // enter second number
c=a+b; // add a and b and store answer in c
cout<<"total="<<c; //show a message and answer in c
return 0; // return 0
} // end of main function body

Output Of Program
Enter First Number:10
Enter Second Number:20
total=30



How This Program Works:


1. #include<iostream.h> // include iostream.h header file
 This C++ instruction is divided in two parts
1. Brown part  : this instruction is used to include ( insert ) a header file named iostream.h into source code. This header file is needed because we have used two objects cout and cin. And this file has necessary information about cout and cin. So if we use these objects in our program, we must write this instruction to include iostream.h in our source program.

2. green part : this part is a single line comment. Comments are used to show any remarks about the instruction. Single line Comments are started with //. These comments are ignored by C++ compiler. 

2. int main()
This indicates the start of the main function. The main function is a compulsory function in a C++ program. int tells that main function will return an integre( whole number ) value. Normally 0 is returned to show successful execution of program.

3. { // start of main function body
 Curly bracket or opening braces is used to indicate start of main function body. We write C++ statements  (  instructions  ) in main function body. Each instruction tells the computer to perform a single task. Each instruction end with a semi colon.


4. int a,b,c; // declare 3 integer variables a,b,c
This instruction is used to declare three variable named a, b and c. A variable is a named memory location. A variable is a small place holder in memory to store some data. For example in this program, we are inputting two whole numbers. So we declared two variable a and b of type int. int is a data type that can support manipulating whole numbers like 10, 4, 500 and 67 etc. No fractional part will be involved. When we will add two numbers in a and b variable then we will store its answer in a third variable called c. So we declared three integer variables in this program


5. cout << "Enter First Number:"; //show message to user to enter first number
cout object helps to show some ouput on screen in C ++  programs. This statement is used to show a text on screen that is enclosed in quotation marks. When we place a text in quotation marks after cout<<, this text will be shown on computer screen as it is. So this statement will show "Enter First Number:" on screen

 6. cin>>a; //input first number
 cin object gets some input from the user while program is running and places it into a variable. In above statement number 6, cin>>a; tells the computer to wait until user enters a number from keyboard and presses Enter key. After pressing enter key the number will be placed in variable a.


7. cout<<"Enter Second Number:"; // show message for second number
See explanation of 5.

8. cin>>b; // enter second number 
Take a number from user and place it into a variable named b.

9. c=a+b; // add a and b and store answer in c 
add the value in variable a to the value of variable b and place the answer in variable c.


10. cout<<"total="<<c; //show a message and answer in c
This statement will show the text "total=" and the value of c. For example, suppose that we enter 10 in a and 20 in b, so there will be 30 in variable c. Now this staement will show the message as:
total=30

11.  return 0; // return 0 
Normally we end the main function with returning 0 that shows the successful execution of the program.

12. } // end of main function body
This closing braces show the end of main function body and end of the C++ program too.

13. After the program a sample run of the program is shown as output of the program in table and in figure above.
Share:

Monday, July 18, 2011

Basic Structure of a C++ Program

So, what is the format of a C++ program? We discussed in previous C++ lessons about some basic programming concepts like program, programming language, program development process, algorithms, flowcharts and so. Here we will discuss basic  structure of a C++ program. The basic structure of a C++ program consists of the following two main parts:

1. Preprocessor Directives

2. main Function

Basic C++ Program Strucrure

Preprocessor Directive number 1
Preprocessor Directive number 2
.
.
.
Preprocessor Directive number n
void main()
{
    C++ statement number 1;
    C++ statement number 2;
      .
      .
      .
    C++ statement number n;

1. Preprocessor Directives

Preprocessor directives are C++ commands given to Compiler. Preprocessor is a part of C++ compiler. Preprocessor acts upon these commands. Preprocessor directives modify source program before compilation.Preprocessor directives start with hash sign #. Preprocessor directives does not end with a semi colon. For example #include is a preprocessor directive. It is used to include header files into our source program. #include<iostream.h> means to include a header file iostream.h  into our source program. If we use cout object or cin object in our program, then we have to include iostream.h header file in our source program, because it contains necessary information about cin and cout object.

2. main Function

A C++ program is divided into small and manageable modules of code called functions. The main function is the starting and compulsory function. The control starts execution of C++ program from the main function. The basic structure of a main function is as follows:
basic-structure-of-C-plus-Plus-Program-in-detail-Explanation-examples
basic-structure-of-C-plus-Plus-Program-in-detail-Explanation-examples

void main()
{
    C++ statement number 1;
    C++ statement number 2;
      .
      .
      .
    C++ statement number n;
}
First line void main() indicates the start of main function. It is called declaration or header of main function. void means this main function will not return any value.
Second line { indicates start of body of main function. Body of main function consists of a set of one or more C++ statements according to the logic and requirement of the program.
C++ statements are also called instructions or commands. Each C++ statment is used to perform a specific task. For example, the follwing statement is used to display "Hello C++" on screen:
cout<<"Hello C++";
Next Lines indicates the presense of a set of one or more C++ statements.  
Here is a basic first program of C++.
Last Line }  shows the end of main function as well as the end of the program.
Let us see an example program according to the basic structure discussed above:

1. #include<iostream.h>

2. void main()

3. {

4. cout<<"Hello C++ Programming!";

5. }
OUTPUT of this program
Hello C++ Programming!

How does this program work?

How does this program work?
  1. [#include<iostream.h>] is used to include header file named iostream.h in source code (First.cpp).
  2. [void main()] indicates Start of main function
void means the main function will not return any value.
  1. { Opening Brace indicates the start of definition of main function.
  2. [cout<<"Hello C++ Programming!";] is used to display “Hello C++ Programming!” on monitor screen.
  3. } Closing Brace indicates the end of main function definition

Share:

C++ Program Development Cycle

The C++ development cycle describes the process to create a program. This process is divided in to four steps as shown in the figure:
Generally, to create a program, you follow these steps:
1. Type the code in a source code editor (Turbo C++, Quincy C++ Compiler, CodeWarrior or some other editor). Here you will write C++ instructions to perform the task, in a predefined format
2. Compile the code.  Compiling means translating source code into object code. If there are errors, you must go back to the code to fix them.
3. Link the code. Linking the code is the process of checking to see whether the code works with all the files that you included in the program. If you get an error, you must return to Step 1 to fix the error.
4. Test the program. You test the program to be sure that it functions properly. Here you will perform the follwing steps:
1. Execute / run the program.
2. Enter sample data
3. Check the output results. Are they accurate?
If your program makes it through all of these steps successfully, then the development cycle is now complete.
Share:

Friday, July 15, 2011

How To Write, Compile and Run Your First C++ Program in Turbo C++

There are three main steps in developing a C++ program:
  1. Type your Program in Turbo C++ Editor
  2. Compile this program, and remove errors, if any.
  3. Execute the program and get output results.
Here I am teaching you all this through a set of pictures with proper titles to explain each step.
First of all, open Turbo C++ IDE to write, compile and run programs in C / C++ easily. you can double click on the short cut of Turbo C++ on desktop of your PC.
Turbo C++ IDE to write, compile and run programs in C / C++
Easyway open Turbo C++ IDE to write, compile and run programs in C / C++

 Now click on the File menu and select New option to create a new file for writing a C / C++ program
create a new file for writing a C / C++ program
Easyway C++ -click on the File menu and select New option to create a new file for writing a C / C++ program
Start typing the C++ program in new file.
typing the C++ program in new file.
Easyway C++ Programs - Start typing the C++ program in new file.
Type your C Plus Plus program, as shown in the figure below:
Type your C Plus Plus program
Easyway C++ Programs Type your C Plus Plus program
Click on File menu and select Save option or press key board shortcut F2 to save the C++ program file .
Save the C++ program file
Save the C++ program file - Easyway C++ Programs.
Save C++ file

type name and press enter

press enter to save C++ file

C++ program saved

Compile C++ program

Compiled successfully C++ program with no errors

Run or execute C++ program

output of C++ program
Share:

How To Start Turbo C++ IDE

Today, I am going to tell you about starting Turbo C++ 3.0 IDE, so that you will be able to write C++ programs. First of all, go to your My Computer icon and double click on it. Open C drive, double click on TC folder and Open BIN folder by double clicking. Here you will see a file named TC.EXE. Double click on it to start Turbo C++ 3.0 IDE. The following pictures will help you to perform all this.






TC.EXE file is in BIN folder. Open this folder.
When you double click TC.EXE, Turbo C++ environment will be before your eyes, as shown below:
Share:

Thursday, July 14, 2011

How To Install Turbo C++ 3.0 - IDE

Note: This tutorial was written by me to install Turbo C++ version 3.0 IDE from an Exe file. Now I have made available for you a pre-installed, ready to download and work TURBO C++ 3.0 file. Please Read This New and Updated Tutorial. Anyhow, you can continue to read this tutorial for information.
First of all, you need to install a C++ IDE- Integrated Development Environment to Start Computer Programming using C++. Turbo C++ 3.0 IDE is one of the best environments to create, edit, compile and run C++ programs. First of all download Turbo C++ 3.0 Installation file. Then perform the following steps according to the pictures:

Double click the installation file.

C

Click Install button to install Turbo C++ 3.0 into C drive.
Turbo C++ 3.0 installer is extracting and copying files....
Normally, the directory paths for Turbo C++ 3.0 require that the main folder name should be TC, so if you see a different name like in the figure shown above, please rename it to C. It is necessary to properly compile and run C++ programs.



Installation process is completed!
Share:

Wednesday, July 13, 2011

Features of C++ Programming Language

Let us discuss important features of C++ Programming Language, in detail. C++ is a powerful and general purpose programming language. It can be used to create not only numerous application programs, but also suitable for system programming. By the passage of time, C++ has become very popular and now it is the preferred programming language to develop professional applications on all plate forms. Following are some important features of C++ programming language:

1. Easy To Learn



C++ is very easy to understand and learn. It uses English like statements that are easy to remember and use. Due to this property of C++, now a days, it is the part of Computer Classes at Bachelor and Master level. C++ is taught to students as Introduction To Programming.
Features of C++ Programming Language

2. Case Sensitive

C++ is case sensitive, it means that it will differentiate between lower case and upper case words. A variable Marks will be considered different from marks, due to lower and upper case. All keywords are written in lower case.

3. Hardware Control

It is used to write programs to control hardware components of computer. It provides the convenience of a high level programming language such as BASIC, COBOL or Pascal, but at the same time allows much closer control of a computer's hardware. C++ is used for system programming.

4. A Small But Powerful language

C++ is a small language with a small number of keywords and programming constructs. But still it is very powerful to develop application as well as system software.

5. Machine Independent

C++ supports machine Independence. It means that a C++ program written on a computer can be run on different computers

6. Faster Code

The latest C++ compilers can generate amazingly faster code. This code is so efficient that its execution speed can be compared with the Assembly language code for the same task.

7. Well-Structured language

Syntax of C++ makes it easy to write programs through modular programming(dividing larger program into smaller and more easily manageable modules. Therefore C++ programs are  easy to understand and maintain.

8. C++ is a superset of C

C++ is a super set to C language. It uses all syntax of C and adds more new features. Major addition is the features that support Object oriented programming.

9. Compatibility With C

As you know C++ is an extension to C language. So it is backward compatible with C. It supports all C language syntax and features. So any C statements can be included in a C++ program.

10. Object Oriented Programming

Important features of C++ Programming language


C++ is an Object oriented language. It supports programming on the basis of objects. An object is a collection of data and related functions. Object may represent a person, thing or place in real world.
OOP is a programming technique in which programs are written on the basis of OBJECTS. Object oriented programs are easier to write, debug and maintain. OOP becomes increasingly helpful, as the programs grow larger. OOP has the greatest potential for simplifying program conceptualization, coding, debugging and maintenance, when we have to develop an application with hundreds of functions. 

Share:

Brief History of C++


C++ - pronounced “See Plus Plus” - is a powerful computer programming language. It was developed by Bjarne Stroustrup at Bell Laboratories in 1985. It is an enhancement to the popular C Language. It fully supports the latest programming technique Object Oriented Programming – OOP.

Brief History of C++

1. During 1960s, many programming languages were developed.
2. In 1963, a language called CPL – Combined Programming Language was developed. It was better to meet the requirements of the market at that time, but very difficult to learn.
short history of c++ Picture of Bjarne stroustrup developer of C++
      
3. In 1967, Martin Richards Developed a new, simplified and modern language called BCPL – Basic Combined Programming Language. BCPL was simplification of CPL.
4. In 1970, Ken Thompson developed B language. 
5. In 1972, Dennis Ritchie developed C language.
6. In 1978 Brian Kernighan and Dennis Ritchie published a book – The C Programming Language. The earlier version of C was known as K & R (Kernighan and Ritchie) C.
7. In 1989 ANSI – The American National Standards Institute produced a newer standardized version of C language called ANSI C. ANSI C introduced new features that were not present in traditional C that is K & R C.
8. In early 1980s, Bjarne Stroustrup at Bell Laboratories started the work to develop C++.
9. In 1985, the first commercial version of C++ was released.
10. In 1990 ANSI Committee started the work on standardization of C++.
11. In 1998 ANSI / ISO C++ standard was approved. ANSI /ISO C++ standards are used by most of the C++ compilers available today. C++ is a superset of C language: that is it incorporates all the operators, functions, statements and syntax of the ordinary C, but adds additional features. C++ enabled the programmers to improve the quality of code. The main reason for these additional features is to support Object Oriented Programming. In addition there are many other new features, too. Today, C++ is widely used to develop Application software as well as system software. There are several versions of the C++ language. The main versions of C++ include Turbo C++,  Borland C++, Code Warrior–Mac and above all Microsoft Visual C++. 

Object Oriented Programming:

OOP is a programming technique in which programs are written on the basis of OBJECTS. Object oriented programs are easier to write, debug and maintain. OOP becomes increasingly helpful, as the programs grow larger. OOP has the greatest potential for simplifying program conceptualization, coding, debugging and maintenance, when we have to develop an application with hundreds of functions. 

Share:

Tuesday, July 12, 2011

Flowcharts in Computer Programming

Definition of Flowchart

Today we will discuss The Role of Flowcharts in Computer Programming. Flowchart is the graphical representation of an algorithm. It is used to show all the steps of an algorithm in a sequence pictorially. An algorithm may be converted to a flowchart. The flowchart is then converted into a program written in any programming language.

Use of Flowchart in Computer Programming with Symbols
Importance and Symbols of Flowchart in Computer Programming

Why to use Flowcharts in Computer Programming?

Advantages of flow charts in computer programming

Advantages of Flowcharts

So what are the main advantages of using Flowcharts in Computer Programming?
Flowchart is used for the following reasons:
 1. Flowchart represents an algorithm in graphical symbols.
 2. It shows the steps of an algorithm in an easy way.

3.
 3. It is used to understand the flow of the program graphically.
 4. Flowchart can be easier and more effective to understand the logic of the given program instantly.
 5. A flowchart will be helpful to the programmer during coding / program development phase.   

Commonly Used Symbols To Draw a Flowchart

So after reading the benefits of using Flowcharts in Computer programming, we will learn how to draw a flow chart. Following are the common symbols used in Flowchart:

1. Start/End

Oval symbol is used to represent the start or end of the flowchart. Every program has a Start and End. So we will add an Oval symbol with caption "Start" in the beginning of each flow chart. Similarly, we will place an Oval symbol with the tag "End" or "Stop" at the end of every flow chart. Flowcharts in Computer Programming Oval Symbol

2. Input/Output

Parallelogram symbol is used to represent an input or output step. So if we wish to input the value of a variable N in our program, we will put a parallelogram symbol there with a caption of "Input N" or "Read N" etc. Similarly, we will use this symbol to represent output statements in program too. For Example, if we encounter an output statement in our program algorithm to show a message "Enter a Number:", we will add a parallelogram symbol with the caption "Enter a Number". If we wish to show the value of a variable, we may add parallelogram symbol with the text "The result =", result. Where "result" is a variable name.
 

3. Process

Rectangle symbol is used to represent a process step. A process may be a calculation or assignment etc. The algorithmic statements like Calculate Sum = Num1 + Num2 can be represented by the rectangle symbol in flowcharts. Similarly, the assignment statements like Width = 10 may also be represented by rectangle symbol.
Flowcharts in Computer Programming Rectangle or Process Symbol
 

4. Selection

Diamond symbol is used to represent a selection step. A condition is given in the diamond. If condition is true then flow of control will go in one direction. If condition is false then control will go in other direction.
Flowcharts in Computer Programming diamond or decision Symbol
For example, we wish to represent an IF statement in a flowchart, say IF Number N is divisible by 2 Then Display "It is an Even Number" Else Display "It is an Odd Number" End IF In this case the diamond symbol will be used along with parallelogram symbols as shown below: Flowcharts in Computer Programming Example of diamond or decision Symbol

5. Flow Lines

Arrow symbols are used to represent the direction of flow in the flowchart. There are four types of flow lines.
Flowcharts in Computer Programming Flow lines arrows Symbol

6. Connector

Circle symbol is used to combine different flow lines. It is used as a connector symbol in flow charts.
Flowcharts in Computer Programming connector Symbol

 

Solved Flow Chart Examples:

Flowchart Example 1 Develop a flowchart to input two numbers from the user, calculate its sum and then display the result.
Example Add Two Numbers Flowcharts in Computer Programming
Example Add Two Numbers Flowcharts in Computer Programming
  Flowchart Example 2 Develop a flowchart to input 5 numbers from the user, calculate its average and then display the result.
Example of Average program Flowcharts in Computer Programming
Example of Average program Flowcharts in Computer Programming

Dear Readers, you just read the role of Flowcharts in Computer Programming in detail with Flow chart definition, symbols, advantages of flow charts and examples of flow charts.


Further Suggested Readings: After Download Free Turbo C++ Ver 3.0 IDE!

Basic Structure of a C++ Program

C++ Program Development Cycle

How To Write, Compile and Run Your First C++ Program

How To Start Turbo C++ IDE

How To Install Turbo C++ 3.0 - IDE

Features of C++ Programming Language

Brief History of C++

Flowcharts in Computer Programming

The Role of Algorithms in Programming

How To Start Computer Programming

What is a Computer Program

- See more at: http://easycppprogramming.blogspot.com
Share:

EasyCPPprogramming.blogspotcom

Labels