Skip to content

Instantly share code, notes, and snippets.

@juanfal
Created October 12, 2012 19:28
Show Gist options
  • Save juanfal/3881006 to your computer and use it in GitHub Desktop.
Save juanfal/3881006 to your computer and use it in GitHub Desktop.
funny example of a chain of calls to subprograms
// functioncalls.cpp
// juanfc 2012-06-24
// funny example of a chain of calls to subprograms
#include <iostream>
using namespace std;
// Prototypes
void a();
void b();
void c();
void d();
void e();
void f();
int main()
{
a();
f(); f(); f();
return 0;
}
void a() { cout << "Subprograms can"; b(); }
void b() { cout << " be called"; c(); }
void c() { cout << " from "; d(); }
void d() { cout << " anywhere in"; e(); }
void e() { cout << " your code."; f(); }
void f() { cout << " And can be repeated!" << endl;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment