Site icon T4Tutorials.com

Declarations Flow table DFT in C++ Programming

Declarations Flow table DFT is used to represent the full life cycle of variables and arrays (and, similar things)and elaborate the life cycle with line numbers of the program containing declarations, initializations, and use.

What is the Declaration (Line Number)?

Mention the line number where the given variable or array is declared in the program.

What is Initialization (Line Number)?

Mention the line number where the given variable or array is initialized in the program.

What is Use(Line Number)?

Mention all the line numbers where the given variable or array is used (excluding declaration and initialization)in the program.

Program

#include <iostream>
using namespace std;
int main() 
{
    int numbers[10], sum = 0;
    cout << "Enter 10 numbers: ";
    //   cout statement to ask user to enter 10 numbers in an array
    //  cin 10 numbers with for loop
    for (int i = 0; i < 10; ++i) 
    {
        cin >> numbers[i];
        sum += numbers[i];
     }   
    cout << "Sum = " << sum << endl;      
    return 0;
}

Declarations Flow table (DFT)

Variable and array Declaration

(Line Number)

Initialization

(Line Number)

Use

(Line Number)

sum 5 5  | 12 14
i 9A 9A | 9C 11 | 12 ||9B
numbers[10] 5 11

12

Exit mobile version