English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2007-02-08 23:01:31 · 4 answers · asked by VARSHA 1 in Computers & Internet Programming & Design

4 answers

save the source code under a proper name
open its text file from BIN(in the form of .txt)
give print command
Note:to print output,take screen shots of the output using "PrintScreenSysRq"
Paste this in Microsoft Word.
give print command

2007-02-08 23:15:12 · answer #1 · answered by arup s 6 · 0 1

U want to print Program
OR
Need the code for print function in C++.

2007-02-09 07:44:22 · answer #2 · answered by Ravi Nanjunda Rao 3 · 0 0

Syntax;

cout<<(variable name);
example
a=5;
cout< ouput
5.

2007-02-09 07:33:10 · answer #3 · answered by mohanasundaram s 1 · 0 0

save this file as source.cpp


#include
#include

using namespace std;


int main () {


int i; //index of for loop
string str;


ifstream f1; //file pointer f1 for reading

system("cls"); //clear the screen
f1.open("source.cpp"); //open source.txt

if (f1.fail()) {
cout << "error: could not find file 'source.cpp'"
<< endl;
system("pause"); //wait
exit(1); // abort program
}


//read all the records
while (! f1.eof() )
{
getline (f1,str);
cout << str << endl;
}

f1.close(); //close the source.cpp file

system("pause"); //wait
}

2007-02-09 07:26:30 · answer #4 · answered by iyiogrenci 6 · 0 0

fedest.com, questions and answers