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.

a program to display 3 variables of different data types

0 votes
asked Jul 9, 2018 by anonymous

1 Answer

0 votes
answered Jul 10, 2018 by John
This is an example I created 5 min ago. Since you didn't specify how you want to display the data, I made two commandline outputs.

#include <iostream>
#include <string>

using namespace std;

int
main ()
{
  int value_int = 6;
  float value_flo = 0.35;

  char value_cha = 'B';
  string value_str = "Es ist nämlich Brotzeit.";

  cout << "iostream:\tIch möchte " << value_int << " " << value_cha <<
    "rote für jeweils " << value_flo << " cent. " << value_str << endl;

  printf ("printf:\t\tIch möchte %i %crote für jeweils %0.2f cent. %s",
      value_int, value_cha, value_flo, value_str.c_str());

  return 0;
}

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