Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

i want to print 12e3 instead of 12000

+4 votes
asked Feb 17, 2025 by Mario GAMBA (160 points)

3 Answers

0 votes
answered Feb 17, 2025 by cpp guy (1,020 points)
in what programming language?
0 votes
answered Feb 17, 2025 by Peter Minarik (101,340 points)

For C/C++, see printf().

printf("%e", 12000.0);
–1 vote
answered Feb 18, 2025 by cpp guy (1,020 points)
reshown Feb 18, 2025 by cpp guy
in c++, you could do this:

#include <iostream>

#define c1 1

#define c2 2

#define c3 'e'

#define c4 3

using namespace std;

int main() {

cout << c1 << c2 << c3 << c4 << endl;

return 0;

}

C version :

#include <stdio.h>
#define c1 1
#define c2 2
#define c3 'e'
#define c4 3
int main() {
  printf("%d%d%c%d\n", c1, c2, c3, c4);
  return 0;
}

Hope this helped.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...