In the previous post, we understand how for loop works and three parts of for loop.In this post, I will discuss the types of for loop or in which way you will use for loop.
For loops are mainly two types:
Infinite for loop
Nested for loop
THE INFINITE FOR LOOP:-
A loop becomes infinite loop if the condition never becomes false. For loop required three parts to run initialization, test expression,...
Friday, 29 September 2017
Sunday, 24 September 2017
Iteration Statement- For Loop
Iteration is a process where a set of instruction or statement is executed repeatedly for a specified number of time or until a condition is met.Iteration statements are commonly known as loops.There are three types of looping statements in C++:
For
While
Do while
A looping is consist of three parts:- initialization, test expression, increment/decrement or update value. A loop will run whenever...
Friday, 22 September 2017
Selection Statement- the switch case statement
THE SWITCH CASE STATEMENT:-
A switch statement is used for multiple-way selections that will branch into different code segments based on the value of a variable or expression. This expression or variable must be of integer data type.
syntax:
switch (expression)
{
case value1:
code segment1;
break;
case value2:
code segment2;
break;
.
.
.
case valueN:
code segmentN;
...
Monday, 18 September 2017
How to write a program without using semicolon in C++?
As we know every line in C++ ends with the semicolon but we can print a string without using any semicolon in the program. we can print string by using if-else, looping or switch case but here I'm print a string with if-else without using the semicolon.
program to print a string without using any semicolon:-
#include<iostream>
using namespace std;
main()
{
if(cout<<"Hello...
Thursday, 14 September 2017
Decision Making Statement:- If-else Statement

Control Statements enable us to specify the flow of program control,i.e. the order in which the instructions in a program must be executed. They make it possible to make decisions, to perform tasks repeatedly or to jump from one section of code to another.
There are four types of control statements...
Saturday, 2 September 2017
What is bits/stdc++.h in C++?(master file in C++)
<bits/stdc++.h> is a master file in c++. It is basically a header file which includes every standard library file. you need this file when you don't know which standard file is included in the program. It saves our time and solves the confusion. Let take an example if you want to find square root of a number, you have to include <math.h> file but if you use <bits/stdc++.h>...
Subscribe to:
Posts (Atom)