F Simple cpp program using break keyword | CodeTheta

Simple cpp program using break keyword

June 14, 2019

Code :
#include<iostream>
using namespace std;
int main() {
    int a=1;
    while (a>0){
        if (a==9)
            break;
        cout<<a<<endl;
        a++;
    }
    return 0;
}


Output : 
1
2
3
4
5
6
7
8

IDE Used To Test This Code : Dev C++

Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us.We will reply you as soon as possible.

Post a Comment