Monday, September 6, 2010

c++ program example

#include 
#include 

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.

0 comments:

Post a Comment

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Laundry Detergent Coupons