Top and Bottam

vkiransrinivas's Avatar, Join Date: Jun 2007
Light Poster
Actually what do you mean by top to bottam and bottam to top.Can i have difference between top to bottam approach and bottam to top approach
0
seeguna's Avatar
Go4Expert Member
Just for an idea i will explain something:

Topdown Approach
Execution starts from top of the program to the end...
Eg: C program
Code:
#include<stdio.h>
void test();
 void main() 
      {
       test();
      }
void test()
{
printf("Test program");
}
 In this program, Execution starts from top of the main function to the bottom ofthe test function.

Eg: Bottom -to -top approach(C++ program)

#include <iostream>
using namespace std;
class sample
{
public:
       void test()
           {
          cout<<"Sample";
          }
};

void main()
        {
        Sample s;
        s.test();
        }
In this program,Execution starts from the bottom of the main function to the test function present in a class.

Last edited by shabbir; 17Oct2007 at 16:17.. Reason: Code block
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
seeguna, have code blocks for code snippets in the posts
0
vkiransrinivas's Avatar, Join Date: Jun 2007
Light Poster
thanks for sending seeguna some explain on theortically with some languages if possible send me