Monday 26 August 2013

Lecture 158

Lecture 158

//Procedures and Functions
//Code:
#include <iostream>
#include <conio.h>
using namespace std;
int f(int);  // Prototype
int g(int);
main ()
{
  int x,y,s=2;
  s*=3;
  y=f(s);
  x=g(s);
  cout<<"\n "<<s<<y<<x;
  getch();
  return 0;
}
int t=8;
int f(int a)
{
  a+=-5;
  t-=4;
  return a+t;
}
int g(int a)
{
  a=1;
  t+=a;
  return a+t;
}


Output: