VB icon

DISPLAY NUMBER

Email
Submitted on: 1/19/2016 9:26:16 AM
By: SHUBHAM SINGH 
Level: Beginner
User Rating: Unrated
Compatibility: C++ (general)
Views: 2152
 
     It just Display the number you enter, in large font .......check it out..:)

 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
//**************************************
// Name: DISPLAY NUMBER
// Description:It just Display the number you enter, in large font .......check it out..:)
// By: SHUBHAM SINGH
//**************************************

#include<iostream.h>
#include<conio.h>
#include<math.h>
#include<iomanip.h>
#define PO(q) pow(10,q)
void main()
{ clrscr();
 double t=1,F1;int C=0,c=0,y=-1,h,q=0,z=-2,M=0; long b,s,l;double a,F,m,f,g=0;
 cout<<"Enter the number to display:-\n";
 cin>>a;long j=a;
 for(F1=a;M==0;F1*=10)
 {z+=1;M=fmod(F1,10);}
 //count digit before decimal
 for(long n=a;fabs(n)>0;n/=10)
 c+=1;
 //count digit after decimal
 long double A=fabs(PO(15)*a);int A1;
 for(t=1;(int)t>0;A/=10)
 {y+=1 ,A1=fmod(A,10);
 if(A1>0)
t=0;}
for( n=A*10;fabs(n)>0;n/=10)
 C+=1;
 for(h=C,m=A*10;h>=1;h--,m/=10)
 { s=fmod(m,10);
 g+=s*PO(h-1);}
 //count digits in reverse no.
 for(n=g;n>0;n/=10)
 {q+=1;}
 // g is reverse of a. like if a=7865, then g=5687
 {for(b=1;b<=8;b++)
 {for(long q21=1;q21<1950000;q21++);
 for(long e=1,n=g;e<=(q?q:1);e++,n/=10)
 {l=fabs(n%10);
 if(a<0 && e==1)
 {switch(b)
{case 5:cout<<"-----" ;break;
default:cout<<" " ;}}
if(fabs(a)>0 && fabs(a)<1 && e==1)
{switch(b)
 {case 1:case 8:
 cout<<" 000 ";break;
 default:
 cout<<" 00";break;
 } }
 if(!(j==a) && e==c+1)
 {switch(b)
{ case 8:cout<<"||";break;
default:cout<<" ";}}
for(int Z=z;Z>=1;Z--)
{if((fabs(a))>0 && (fabs(a))<1 && e==1)
{switch(b)
 {case 1:case 8:
 cout<<" 000 ";break;
 default:
 cout<<" 00";break;
 } }}
 switch(l)
 {case 1:
 //for(1)
 switch(b)
 {case 2:
 cout<<"111 ";break;
 case 3:
 cout<<" 1111 ";break;
 default:
 cout<<"11 ";break;
 case 8:
 cout<<" 1111111";}break;
 case 0:
 //for(0)
 {switch(b)
 {case 1:case 8:
 cout<<" 000 ";break;
 default:
 cout<<" 00";break;
 }}break;
 case 2:
 //for (2)
 {switch(b)
 {case 1:
 cout<<"222 ";break;
 case 2:
 cout<<" 22";break;
 case 3:
 cout<<" 2 ";break;
 case 4:
 cout<<"2 ";break;
 case 5:
 cout<<"2";break;
 case 6:
 cout<<" 2";break;
 case 7:
 cout<<" 22";break;
 case 8:
 cout<<" 222222";break;}}break;
 case 3:
 //for(3)
 {switch(b)
 {case 1:
 cout<<" 33333 ";break;
 case 2:
 cout<<"3 ";break;
 case 3:
 cout<<"3";break;
 case 4:case 8:
 cout<<" 333 ";break;
 case 5:
 cout<<" 3 ";break;
 case 6:
 cout<<" 3";break;
 case 7:
 cout<<" 33 ";break;
 }}break;
 case 4:
 //for(4)
 {switch(b)
 {case 2:
 cout<<"44 ";break;
 case 3:
 cout<<"4 4 ";break;
 case 5:
 cout<<" 444444";break;
 case 6:case 7:case 1:
 cout<<" 4 ";break;
 case 8:
 cout<<"444";break;
 case 4:
 cout<<" 4 4 ";break;
 }}break;
 case 5:
 //for(5)
 {switch(b)
 {case 1:
 cout<<" 555555";break;
 case 2:case 3:
 cout<<" 5 ";break;
 case 4:
 cout<<" 5555 ";break;
 case 5:
 cout<<" 5 ";break;
 case 6:
 cout<<" 5";break;
 case 7:
 cout<<" 55 ";break;
 case 8:
 cout<<" 555 ";break;
 }} break;
 case 6:
 //for(6)
 {switch(b)
 {case 1:
 cout<<"666 ";break;
 case 2:
 cout<<" 6";break;
 case 3:case 4:
 cout<<" 6 ";break;
 case 5:
 cout<<" 66666 ";break;
 case 6:case 7:
 cout<<" 66";break;
 case 8:
 cout<<" 6666 ";break;
 }}break;
 case 7:
 //for(7)
 {switch(b)
 {case 1:
 cout<<" 7777777";break;
 case 2:
 cout<<" 7 7";break;
 case 3:
 cout<<" 7 ";break;
 case 4:
 cout<<" 7 ";break;
 case 5:
 cout<<"7";break;
 default:
 cout<<"7";break; }} break;
 case 8:
 //for(8)
 {switch(b)
 {case 1:case 5:case 8:
 cout<<" 8888 ";break;
 default:
 cout<<" 88"; }} break;
 case 9:
 //for(9)
 {switch(b)
 {case 8:
 cout<<"999 ";break;
 case 7:case 6: case 5:
 cout<<" 9";break;
 case 4:
 cout<<" 99999";break;
 case 3:case 2:
 cout<<" 99";break;
 case 1:
 cout<<" 9999 ";break;
 }}break;}}cout<<endl;}
}getch();}


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

1/20/2016 4:32:31 AMSHUBHAM SINGH

please rate this code,
your ratings are precious
THANK YOU
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.