Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Showing powers, cubes and squares in a console window

Showing powers, cubes and squares in a console window

Scheduled Pinned Locked Moved C / C++ / MFC
c++winformshelptutoriallearning
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    toprogramminguy
    wrote on last edited by
    #1

    hi, I'm just a beginner at programming(c++) and I wanted to create a program to do binomial expansions easily, I have created the program and it works well. But because i'm a beginner at programming i'm using a win32 console for the program and i want to show powers, squares and cubes, which in the output of my program look like this: 2^3 0r 4^2 is there any way to show them as you would write them, like in superscript or something cos at the moment it looks a mess. Hope you understand my problem. Any answers appreciated ps if you have any recomendations on C++ books which include how to use windows forms to create a program they would be appreciated

    D L 2 Replies Last reply
    0
    • T toprogramminguy

      hi, I'm just a beginner at programming(c++) and I wanted to create a program to do binomial expansions easily, I have created the program and it works well. But because i'm a beginner at programming i'm using a win32 console for the program and i want to show powers, squares and cubes, which in the output of my program look like this: 2^3 0r 4^2 is there any way to show them as you would write them, like in superscript or something cos at the moment it looks a mess. Hope you understand my problem. Any answers appreciated ps if you have any recomendations on C++ books which include how to use windows forms to create a program they would be appreciated

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      toprogramminguy wrote:

      is there any way to show them as you would write them, like in superscript...

      Yes, but the exponent would be a whole line above the base.

      "Love people and use things, not love things and use people." - Unknown

      "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

      1 Reply Last reply
      0
      • T toprogramminguy

        hi, I'm just a beginner at programming(c++) and I wanted to create a program to do binomial expansions easily, I have created the program and it works well. But because i'm a beginner at programming i'm using a win32 console for the program and i want to show powers, squares and cubes, which in the output of my program look like this: 2^3 0r 4^2 is there any way to show them as you would write them, like in superscript or something cos at the moment it looks a mess. Hope you understand my problem. Any answers appreciated ps if you have any recomendations on C++ books which include how to use windows forms to create a program they would be appreciated

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        exponents of 2 and 3 have their own symbols in unicode. You will have to stick with x^4 for exponents of 4 (and 5, etc), but they're definitely there for 2 and 3. You will need to compile for unicode in order to use these characters. You can compile for Unicode by defining the symbols UNICODE and _UNICODE in your compiler definitions. If you go into character map and search for "superscript" then you will get 5 results, four of which may be helpful to you. Those are the characters you need to use. http://img122.imageshack.us/my.php?image=superscriptja8.jpg[^]

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups