sample programs

3
The C preprocessor or cpp is the macro preprocessor for the C and C++ computer programming languages . The preprocessor provides the ability for the inclusion of header files , macro expansions, conditional compilation , and line control. In many C implementations, it is a separate program invoked by the compiler as the first part of translation. The language of preprocessor directives is only weakly related to the grammar of C, and so is sometimes used to process other kinds of text files . 2. #include <iostream> #include<conio.h> using namespace std; // Class Declaration class person { //Access - Specifier public: //Varibale Declaration string name; int number; }; //Main Function int main() { // Object Creation For Class person obj; //Get Input Values For Object Varibales cout<<"Enter the Name :"; cin>>obj.name; cout<<"Enter the Number :"; cin>>obj.number; //Show the Output cout << obj.name << ": " << obj.number << endl;

Upload: oliver-galit-adoptante

Post on 04-Oct-2015

2 views

Category:

Documents


1 download

DESCRIPTION

C++

TRANSCRIPT

The C preprocessor or cpp is the macro preprocessor for the C and C++ computer programming languages. The preprocessor provides the ability for the inclusion of header files, macro expansions, conditional compilation, and line control.In many C implementations, it is a separate program invoked by the compiler as the first part of translation.The language of preprocessor directives is only weakly related to the grammar of C, and so is sometimes used to process other kinds of text files.2.#include #includeusing namespace std;

// Class Declarationclass person{//Access - Specifierpublic:

//Varibale Declaration string name; int number;};

//Main Functionint main(){ // Object Creation For Class person obj;

//Get Input Values For Object Varibales coutobj.name;

coutobj.number;

//Show the Output cout