Professional Documents
Culture Documents
EX 1
/* Nested Loop Ex1 - Create a C++ program that will input
size of equilateral triangle 2 to 50 is the valid
size. Prompt the user to input any key to try again
and X/x to exit
CRISTINA A. PASCUA
CS10-lL/A3
May 12, 2016
*/
#include <iostream>
#include <cctype>
int main()
{ int size, row, col;
char tryagain;
do{
system("cls");
do{
cout<<"Input size of equilateral triangle (2-50) : ";
cin>>size;
if(size<2 || size>50)
cout<<size<<" is INVALID"<<endl;
}while(size<2 || size>50);
cout<<endl<<endl;
system("pause");
return 0;
}
EX 2 OUTLINE TRIANGLE
/* Nested Loop Ex1 - Create a C++ program that will input
size of equilateral triangle 2 to 50 is the valid
size. Prompt the user to input any key to try again
and X/x to exit
CRISTINA A. PASCUA
CS10-lL/A3
May 12, 2016
*/
#include <iostream>
#include <cctype>
int main()
{ int size, row, col;
char tryagain;
do{
system("cls");
do{
cout<<"Input size of equilateral triangle (2-50) : ";
cin>>size;
if(size<2 || size>50)
cout<<size<<" is INVALID"<<endl;
}while(size<2 || size>50);
cout<<endl<<endl;
system("pause");
return 0;
}