Syvum Home Page

Home > Quiz Games > C++ Programming > Print Preview

C++ Programming : Program 1-A

C++ Program to output an integer, a floating point number and a character


 

#include <iostream.h>
#include <conio.h>

void main()
{
  clrscr();
  int x = 10;
  float y = 10.1;
  char z = 'a';
  cout << "x = " << x << endl;
  cout << "y = " << y << endl;
  cout << "z = " << z << endl;
  getch();
}

This program has pre-defined values for an integer x, floating point number y, and a character z.
These three values are outputted using the 'cout' command.

No inputs from the user for this program.

x = 10
y = 10.1
z = a

Index of C++ Programs
 

-
-
 
45 more pages in C++ Programming

Contact Info © 1999-2017 Syvum Technologies Inc. Privacy Policy Disclaimer and Copyright