Structure of the Problem Requirements
In this problem we will learn how to use a break statement in for loop. Break statement is use to finish the iteration of loop in a specific point . Here is the Source code of this problem which help you in better understanding .
Source Code
#include<iostream>
using namespace std;
int main ()
{
for (int i =1; i < 9; i++)
{
if (i==7)
break;
cout<<i<<endl;
}
}
Output of the Program
Break Statement |
Asad Niazi is Software Engineer , Programmer, Web Developers and a young mentor of Tech Solutions Desk and Blogging Solutions . Asad Love to writes about Technology, Programming, Blogging and make money online.
0 comments:
Post a Comment