0% found this document useful (0 votes)
38 views2 pages

Input and Output

Uploaded by

lysarith09
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views2 pages

Input and Output

Uploaded by

lysarith09
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Input and Output:

Example 1: example.cpp
#include<iostream>
using namespace std;

int main(){
cout << "Hello World!!!";
cout << "Hello C++!!!";
cout << "Hello Our Class";
return 0;
}
Output:

Example 2: example2.cpp
#include<iostream>
using namespace std;

int main(){
cout << "Hello World!!!\n";
cout << "Hello C++!!!\n";
cout << "Hello Our Class\n";
return 0;
}
Output:

Example 3: example3.cpp
#include<iostream>
using namespace std;

int main(){
cout << "Hello World!!!" << endl;
cout << "Hello C++!!!" << endl;
cout << "Hello Our Class" << endl;
return 0;
}
Output:
Example 4: example4.cpp
#include<iostream>
using namespace std;

int main(){
cout << "Hello World!!!\t" << endl;
cout << "\\Hello C++!!!" << endl;
cout << "\"Hello Our Class" << endl;
return 0;
}
Output:

Example 5: example5.cpp
#include<iostream>
#include<string>
using namespace std;
int main(){
float price, total;
int qty;
cout << "Type Price: ";//Extraction Operator
cin >> price; //Insertion Operator
cout << "Type Qty: "; //Extraction Operator
cin >> qty; //Insertion Operator
total = price * qty; //Arithmetic Operator
cout << "Total: " << total << endl;
return 0;
}
Output:

You might also like