How to make a box in c++?

Discussion in 'C' started by colesantosjr, Oct 14, 2010.

  1. colesantosjr

    colesantosjr New Member

    Joined:
    Oct 14, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    I'm a newbie here and still studying. Im just wondering if there's anyone around here that can help me to do the program.

    The problem given to me by our professor is to get the perimeter and area of a circle. Only radius will be type by the user then it will automatically compute for the perimeter and area. I don't have problem in these. My problem is that we need to put the answers inside the box AND I DON'T KNOW HOW TO DO THE DAMN BOX. This is how it should appear:

    ****** RADIUS******
    * *
    * *
    * *
    ******************

    ******AREA****** ******PERIMETER******
    * * * *
    * * * *
    * * * *
    **************** ********************

    Can anyone help me how to write these in C++?
     
  2. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    2
    Trophy Points:
    0
    Just print sequentially
     
  3. techgeek.in

    techgeek.in New Member

    Joined:
    Dec 20, 2009
    Messages:
    572
    Likes Received:
    19
    Trophy Points:
    0
    Occupation:
    EOC (exploitation of computers)..i m a Terminator.
    Location:
    Not an alien!! for sure
    Home Page:
    http://www.techgeek.in
    I got your problem...use gotoxy() function to draw characters with desired positions..get back to me for more help....
     
  4. umartayyabkhan

    umartayyabkhan New Member

    Joined:
    Jan 21, 2011
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Electrical Engineering Student
    Location:
    Peshawar
    Home Page:
    http://www.al-quran.kk5.org
    Is this u r looking for?
    [/CODE]#include<stdio.h>
    #include<conio.h>
    main(){

    int x,y,z;
    char f;
    printf("ENTER A NUMBER");

    scanf("%d",&z);


    printf("\n\n");

    for(x=0;x<z;x++){
    for(y=0;y<z;y++){
    printf("*");}
    printf("\n");










    }

    getch();
    }



    [/CODE]
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice