Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,004 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,372 people online right now. Registration is fast and FREE... Join Now!




Help homework problem swasthik symbol

 
Reply to this topicStart new topic

Help homework problem swasthik symbol

prvn.coll92
15 Jan, 2008 - 08:44 AM
Post #1

New D.I.C Head
*

Joined: 8 Jan, 2008
Posts: 1

CODE
#include<iostream.h>
#include<conio.h>
const int n=5;
void main()
{
    clrscr();
    char a[n][n];
    int i,j;
    for(i=0;i<n;i++)
    {
        for(j=0;j<n;j++)
        {
            if((i==n/2)||j==n/2)||(i==0&&(j!=(n/2)+1)||(i==n-1&&j!=(n/2)-1)|| (j==(n-1))&&i!=(n/2)+1)
            a[i][j]='*';
            else
            a[i][j]=' ';
        }
    }
    clrscr();
    for(i=0;i<n;i++)
    {
        for(j=0;j<n;j++)
        {
            cout<<a[i][j]<<' ';
        }
        cout<<endl;
        }
    }
}



*mod edit - added [code] tags
User is offlineProfile CardPM
+Quote Post

jjhaag
RE: Help Homework Problem Swasthik Symbol
15 Jan, 2008 - 11:42 AM
Post #2

me editor am smartastic
Group Icon

Joined: 18 Sep, 2007
Posts: 1,789



Thanked: 2 times
Dream Kudos: 775
Expert In: C,C++

My Contributions
Moved to C/C++.

Please post in the correct forum, read the rules, and use the code tags like this: code.gif when posting source code.

What is the problem? If you don't aska question, you're unlikely to receive an answer - we aren't going to just go through, figure out what the code is for, debug it, and post a solution for you.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/1/08 12:29PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month