My Blog
Articles related to programming, computer science, technology and research.

CPP program to illustrate enumerations

05/03/2017 Categories: Others.

A program to illustrate enumerations. Program is as follows:

Input and output for the above program are as follows:

CPP program to illustrate scope resolution new and delete operators

05/03/2017 Categories: Others.

A program to illustrate scope resolution, new and delete operators. Program is as follows:

Output for the above program is as follows:

CPP program to calculate the fare for the passengers travelling in a bus

05/03/2017 Categories: Others.

Write a Program to calculate the fare for the passengers travelling in a bus. When a Passenger enters the bus, the conductor asks “What distance will you travel?” On knowing distance from passenger (as an approximate integer), the conductor mentions the fare to the passenger according to following criteria: 5KM: Rs.10 5-10KM: Rs.20 10-30KM: Rs.50 […]

CPP program to calculate simple interest and compound interest

05/03/2017 Categories: Others.

A program that computes the simple interest and compound interest payable on principal amount(in Rs.) of loan borrowed by the customer from a bank for a given period of time (in years) at specific rate of interest. Assume that interest is compounded monthly. Program is as follows:

Input and output for the above program […]

CPP program to read name of the user and print it back

05/03/2017 Categories: Others.

A simple program on printing “Hello World” and “Hello Name” where “Name” is the input from the user. Program is as follows:

Input and output for the above program are as follows:

CPP program to demonstrate for loop

20/02/2017 Categories: Others.

This program demonstrates the use of for loop in C++. This program reads two numbers a and b from the user. For every number in the range a to b, if the number is in between 1 and 9, we have to print the word form of that number (for example, if the number is […]

CPP program for if else statement

20/02/2017 Categories: Others.

This program accepts a number (integer) from user. If the given number is n and 1 <= n <= 9, then we have to print the word for the given number (for example, if n is 2, we have to print two). If the given number is greater than 9, then print Greater than 9. Code is […]

CPP program to display basic data type values

20/02/2017 Categories: Others.

This is a C++ program to read and print basic data type values. The float type value must be corrected to 3 places and double type value must be corrected to 9 decimal places. To make this happen, we used fixed and setprecision available in iomanip header file. Code is as follows:

Input and output for the above program […]

CPP program to read three integers and print their sum

20/02/2017 Categories: Others.

This is a C++ program to read three numbers from user and print the sum of those numbers:

Input and output for the above program are as follows:

CPP program to print Hello World

20/02/2017 Categories: Others.

This is C++ program to print Hello World! to the stdout (generally console).

Output for the above program is as follows:

Scroll Up