Tag Archives: break

CPP02 – Write a CPP program to explain the use of for loop, while loop, switch-case, break and continue statements.

CPP02 – Write a C++ program to explain the use of for loop, while loop, switch-case, break and continue statements. CODE:- #include<iostream.h> #include<conio.h> void main() { int i; clrscr(); cout<<“FOR LOOP”<<endl; for(i=1;i<6;i++) cout<<i<<endl; cout<<“WHILE LOOP”<<endl; while(i>1) cout<<–i<<endl; cout<<“DO WHILE LOOP”<<endl; do { cout<<i++<<endl; }while(i<6); getch(); } [codesyntax lang=”cpp”] #include<iostream.h> #include<conio.h> void main() {  int i;… Read More »