Please is there anyway in outputting subscripts and superscript notations in c++

Recommended Answers

All 2 Replies

Superscripts and subscripts are an artifact of a rendering process; they are not native to the C++ language.

To what platform or format?
If you're talking about to the console, eh, you're going to have to write a function that generates an array of multiple lines and offsets the sub and super script text to their corresponding position in the main line of text.

For example:

n   2
a=E   i
   i=0

The n and the 2 in the superscript have to be spaced to match up with the E and the i respectively. The i=0 has to be spaced to match up with the E.

And that looks like it'd be fun to write.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.