Skip to content

Instantly share code, notes, and snippets.

View sheetal369's full-sized avatar

Sheetal Sharma sheetal369

View GitHub Profile
@sheetal369
sheetal369 / prototype.cpp
Created December 16, 2019 14:34 — forked from pazdera/prototype.cpp
Example of `prototype' design pattern in C++
/*
* Example of `prototype' design pattern.
* Copyright (C) 2011 Radek Pazdera
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
#include<iostream>
using namespace std;
class date
{
private:
int day;
int month;
int year;
#include <iostream>
using namespace std ;
class naturalNo
{
private :
int num ;
public :
void setdata (int a)
#include <iostream >
#include <cstring>
using namespace std ;
class library
{
private :
int bookNo ;
string Author ;
#include <stdio.h>
// C function for extended Euclidean Algorithm
int gcdExtended(int a, int b, int *x, int *y)
{
// Base Case
if (a == 0)
{
*x = 0;
*y = 1;
#include<iostream>
#include<conio.h>
#include<stdlib.h>
using namespace std;
int gcd(int u, int v)
{
return (v != 0) ? gcd(v, u % v) : u;
}
#include <iostream>
using namespace std;
int rem, quot ;
int hcf (int, int) ;
int main()
{
cout << "Input two numbers : ";
#include <iostream>
using namespace std;
int rem, quot ;
int hcf (int, int) ;
int main()
{
cout << "Input two numbers : ";
int a, b, num1, num2, hcf_num ;
/* cin >> a, b ; //USING COMMA IS A SYNTAX ERROR */
#include <iostream>
using namespace std;
int main()
{
int noOfStu, i;
cout << "Enter the number of Students in a Class : ";
cin >> noOfStu ;
#include <iostream>
using namespace std;
int functCall ();
int main ()
{
int howMany , i, result;
cout << "How many time do you wan to call function : ";