Use of cout & cin manipulator in c++
Write a C++ program that will print output in the following form. Make sure your output looks exactly as shown here (including spacing, line breaks, punctuation, and the title and author). Use cout and cin objects and endl manipulator.
******************************
* Programmimg Assignment 1 *
* Computer Programmimg I *
* Author : ??? *
* Due Date: Thursday, Dec. 20 *
******************************
PROGRAM CODE :
#include<iostream>
using namespace std;
int main()
{cout<<"\n ******************************"<<endl;
cout<<" * Programmimg Assignment 1 *"<<endl;
cout<<" * Computer Programmimg I *"<<endl;
cout<<" * Author : ??? *"<<endl;
cout<<" * Due Date: Thursday, Dec.20 *"<<endl;
cout<<" ******************************";
cout<<endl<<“DHRUVESH”<<endl<<“19DCE133”;}
OUTPUT:
CONCLUSION:
In c++ for print we use cout and goto new line we use endl manipulator.
Que:Diffrence between endl and \n.
Ans: endl take more compilation time then \n. In endl code is goto buffer and then show
The output.endl take one more space then \n.
Comments
Post a Comment