Test_2 - int main int i=2 while(i<20 Sheet1 Page 2 i=i*i...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 #include <iostream> #include <cmath> using namespace std int main () { for(int i=5 i>0 i--){ for (int j=0 j<i j++) cout<<"* " cout<<endl } } #include <iostream> #include <cmath> using namespace std int main () { for(int i=1 i<=4 i++){ for(int j=1 j<=5 j++) cout<<i<<j<<" " cout<<endl } } #include <iostream> #include <cmath> using namespace std int main () { int a=0, i=12 while (i>0){ a=a+i i=i-2 cout<<a<<endl } } #include <iostream> #include <cmath> using namespace std
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: int main () { int i=2 while(i<20) Sheet1 Page 2 i=i*i cout<<i<<endl } sol: 256 #include <iostream> #include <cmath> using namespace std int main () { int a=7 do{ cout<<"This is a test."<<endl a++ }while(a<5) cout<<a<<endl } int base cout<<"Enter the base"<<endl cin>>base { for(int i=1 i<base i++){ for (int j=1 j<i j++) cout<<"* "<<" " cout<<endl } } return 0 } } sol: right triangle...
View Full Document

This note was uploaded on 05/16/2010 for the course CISCO EST61 taught by Professor Miller during the Spring '10 term at Fresno City College.

Page1 / 2

Test_2 - int main int i=2 while(i<20 Sheet1 Page 2 i=i*i...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online