Switch to full style
For C/C++ coders discussions and solutions
Post a reply

Cube number

Thu Apr 05, 2007 9:06 pm

This program take from you a number and check it if it valid to form astairs it tell you the number of different sides and draw it, else tell you that this number is invalid

Code:
#include
using namespace std;

int main()
{
    
int n,sides,i;
    
char choise;
    
coutn">n;
        for(i=1;n>0;i++)
            n=n-i;
        if(n==0)
        {
            sides=4*(i-1);
            cout>n;
            if(n==1)
            {
                for(int m=0;m>choise;
    }while(choise=='y'||choise=='Y');
    cout"
>choise;
    return 
0;




Post a reply
  Related Posts  to : Cube number
 draw cube 3d java-Cube 3D     -  
 3D-Cube     -  
 Cube Series     -  
 cube 3d transformation     -  
 convert integer number to octal,hexadecimal number systems     -  
 Draw 3d cube using openGL     -  
 convert octal number to decimal number     -  
 convert decimal number to octal number     -  
 Number with dot in php     -  
 Number Conversion     -  

Topic Tags

C++ Algorithms