This C++ program uses a for loop to iterate from 0 to 9 (inclusive) and print the values of the loop variable i, except when i equals 4. When i equals 4, the loop is exited prematurely using the break statement. Here's a breakdown of the program's logic:
#include<iostream> using namespace std; int main() { for(int i=0;i<10;i++) { if (i==4) { break; } cout<<i<<"\n"; } return 0; }To download raw file Click Here
012356789
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions