Implementing Boundary Value Analysis of Software Testing in a C++ program?

#include<iostream>`
`#include<stdlib.h>`

`using namespace std;`

`int main()`
`{`
`int n,a[n],x,c,u[n],m[n],e[n][4];`
`cout<<"Enter the number of variables";`
`cin>>n;`

` cout<<"Enter the Lower, and Upper Limits of the variables";`
`for(int y=1; y<n+1; y++)`
` {`
` cin>>m[y];`
` cin>>u[y];`
` }`
` for(x=1; x<n+1; x++)`
` {`
`a[x] = (m[x] + u[x])/2;`
`}`
` c=(n*4)-4;`
` for(int a1=1; a1<n+1; a1++)`
` {`


` e[a1][0] = m[a1];`
` e[a1][1] = m[a1]+1;`
`e[a1][2] = u[a1]-1;`
` e[a1][3] = u[a1];`

` }`
for(int i=1; i<n+1; i++)`
{
` for(int l=1; l<=i; l++)`
` {`
`if(l!=1)`
` {`
` cout<<a[l]<<"\t";`
` }`
` }`
` for(int j=0; j<4; j++)`
` {`
` cout<<e[i][j];`
` for(int k=0; k<n-(i+1); k++)`
` {`
`cout<<a[k]<<"\t";`
` }`
` cout<<"\n";`
` }`
` } `

` system("PAUSE");`
` return 0; `
}`


The answer should come in the form of a table like


1 50 50
2 50 50
99 50 50
100 50 50
50 1 50
50 2 50
50 99 50
50 100 50
50 50 1
50 50 2
50 50 99
50 50 100

if the no of inputs is 3 and their ranges are
1,100
1,100
1,100
(could be varied too)

The output is not coming,can anyone correct the code or tell me what's wrong?
It accepts number of variables and their ranges, i.e the maximum and minimum values those variables can get. Then it performs bpundary value analysis and prints the output like the table shown. Minimum value, maximum value, min value + 1, max value + 1, nominal value. maybe this link can make you understand en.wikipedia.org/wiki/Boundary-value_analysis
[code] "Please use code tags" [/code]
The code executes sequentially from top to bottom.
Arrays don't get resized. Their size is fixed at [i]compile[/t] time.
Array index goes from 0 to n-1

I don't know what is the limit of character for naming a variable. But it is quite big, use meaningful names.
Topic archived. No new replies allowed.