How can I print any number or character using cout in C++
I am working in the XYZ company as programmer. From last month I am working on the one project which uses the C++ language for programming. Hence, while working on the project in one place I have to print the number on the form. But I can not came to know which statement can I use. So, I want to know about the cout statement of the C++ language. Can anyone tell me about the cout statement??
CPP : How can I print any number or character using cout in C++
The cout can be an object of the class ostream that can represents the standard output stream. The cout can be corresponds to the cstdio stream stdout. By using the cout statement you can be able to print the any character or the number that can be on the form. I hope you can understand from the above description of the cout statement. If you can not understands then reply me!!!
re: How can I print any number or character using cout in C++
This program can demonstrates you that how to print the anything in the forum using the cout statement of the C++ language as follows :
Code:
#include <iostream>
using namespace std;
int main()
{
cout << " Michael Hawkinberry\n6393 Harlem-Grovetown Road,
Harlem, Georgia, 30814\n(706) 556-3731\nComputer Science " << endl;
return 0;
}
Re: How can I print any number or character using cout in C++
Most of the systems can have their standard output set that can be to the console where text messages can be shown even though this can be redirected, By default. Because cout can be an object of the class ostream. You can write the characters to cout either as unformatted data using the write member function or formatted data that can be using for an example the insertion operator as like ostream::oprtr<<.
Re: How can I print any number or character using cout in C++
For printing a value onto the screen you can have to write the word cout that can be followed by the operator (<<) that can be insertion operator which you can create by typing the character (<) twice.
Code:
#include <stdlib.h>
#include <iostream.h>
int main()
{
char *url = "WWW";
while(*url)
cout.put (*url++);
cout<<endl;
return 0;
}
Re: How can I print any number or character using cout in C++
PROGRAM :
Code:
#include <iostream.h>
int main()
{
cout << "Hello there.\n";
cout << "Here is 6: " << 6 << "\n";
cout << "The manipulator endl writes a new line to the screen." <<
Âendl;
cout << "And a very very big number:\t" << (double) 7000 * 7000 <<
Âendl;
cout << "Don't forget to replace Baski with your name...\n";
cout << "Baski is a C++ programmer!\n";
return 0;
}
OUTPUT :
Code:
Hello there.
Here is 6: 6
The manipulator endl writes a new line to the screen.
And a very very big number: 4.9e+07
Don't forget to replace Baski with your name...
Baski is a C++ programmer!