{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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 if((row==n/4)&&(col==n/3)) cout<<"*"; //eye2 else if((row==n/4)&&(col==2*n/3)) cout<<"*"; //nose else if((row==n/2)&&(col==n/2)) 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)&&(col==n/5)||(row==3*n/4)&&(col==n/4)|| (row==3*n/4)&&(col==n/2)||(row==3*n/4)&&(col==3*n/4)||(row==3*n/5)&&(col==4*n/5)) cout<<"*"; //otherwise else cout<<" "; } cout<<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

{[ snackBarMessage ]}