THE FOLLOWING TABLE SOME ESCAPE SEQUENCES ARE GIVEN. USE THESE ESCAPE SEQUENCE INTO THE FIRST.CPP
PROGRAM AND LIST THE OUTPUT.
First.cpp
#include <iostream> //this is preprocessor directive
using namespace std; //tells the compiler certain objects such as cout are contained
in the standard namespace (USED WITH DEV C++ COMPILER)
int main () //this is the main function
{
cout << "See mom! I wrote my first C++ program\n";
getchar(); //wait for the enter key to be pressed. Try the program without this line and write what you
have observed with or without this line..
return 0;
}
#include<iostream>//this is preprocessor directive
using namespace std;//tells the compiler certain objects such as cout are contained
//in the standard namespace(USED WITH DEV C++ COMPILER)
int main()//this is the main function
{
cout<<"See mom! I wrote my first C++ program\n";//output string of characters
getchar(); //with this operator the program waits
// for input character from user
//getchar();without this operator the program ends
return 0;
}
Comments
Leave a comment