Monday 11 November 2013

using class c++ - rahul nayar k


// Header Files
#include <iostream>
#include<conio.h>
using namespace std;

// Class Declaration
class rahul nayar shree-capital 
{
//Access - Specifier
public:

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

//Main Function
int main()
{
    // Object Creation For Class
    rahul nayar shree-capital obj;

    //Get Input Values For Object Varibales
    cout<<"Enter the Name example rahul nayar k :";
    cin>>obj.name;

    cout<<"Enter the Number  :";
    cin>>obj.number;

    //Show the Output
    cout << obj.name << ": " << obj.number << endl;

    getch();
    return 0;
}

No comments:

Post a Comment