Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Q1.

Calculate cyclomatic complexity for the following code:

#include <stdio.h>

Void main()

Int a,b,c;

A=20;

B=30;

c=40;

if (b > c)

a=a+10;

else if(b==c)

a=c;

else

a=a-10;

printf(“%d %d %d”, a, b, c);

Answer:M=3

Q2. Calculate the average number of live variables in the above code.

You might also like