smileyface - //mouth else

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//N-Sized Square with smiley face #include <iostream> using namespace std; int main() { int n; int row; int col; cout<<"Enter value for n"<<endl; cin>>n; for(row=0;row<n;row=row+1) { for(col=0;col<n;col=col+1) { if((row==0)||(row==n-1)||(col==0)||(col==n-1)) cout<<"*"; //eye1 else cout<<"*"; //eye2 else if((row==n/4)&&(col==2*n/3)) cout<<"*"; //nose cout<<"*";
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: //mouth else if((row==3*n/5)&amp;&amp;(col==n/5)||(row==3*n/4)&amp;&amp;(col==n/4)|| (row==3*n/4)&amp;&amp;(col==n/2)||(row==3*n/4)&amp;&amp;(col==3*n/4)||(row==3*n/5)&amp;&amp;(col==4*n/5)) cout&lt;&lt;&quot;*&quot;; //otherwise else cout&lt;&lt;&quot; &quot;; } cout&lt;&lt;endl; } return 0; //I have been in this lab a good lil bit past forever, continuously testing and compiling, but I still cant seem to get the program to run right }...
View Full Document

This document was uploaded on 05/01/2011.

Ask a homework question - tutors are online