• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

representing exponents like x to the power 2 3 and so on

 
DHARMENDRA perisetla
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want display x square x cube and so on
can some one help me
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to ask a more specific question. How do you want to display this information? Are you simply interested in calculating the value of x squared or x cubed and then "displaying" it? Or are you writing some kind of math software that needs to display these in an equation of some sort?
Are you writing a text-based program? Or are you developing a GUI?
These questions should help give you ideas. In short, we need more details about your specific problem in order to help much.
Keep coding!
Layne
 
DHARMENDRA perisetla
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to display the equation in a text based program.It is a kind of Math software where u have to display the equation.
displaying like this (x^4)is not what i need.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So are you asking how to display a superscript?
 
DHARMENDRA perisetla
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes i want to display superscript
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use Unicode characters ( http://www.unicode.org/charts/PDF/U2070.pdf )but I don't think they will display properly on the console.
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Text-based output is very limited. That is why something like x^4 is commonly used. As mentioned Unicode can give you more options, but it is still limited by the display capabilities of the platform you are running on. In order to produce output similar to that in a text book, you will probably have to use some kind of graphical display that can manipulate the font properties.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic