jeudi 8 mars 2018

independent paths of power number

This program is basically for calculating the power of any number.

1 begin
2 int a, b, pow;
3 float c;
4 input(a, b);
5 if (b < 0)
6 pow = -b;
7 else
8 pow = b;
9 c = 1;
10 while ( pow!=0) {
11 c=c*a;
12 pow = pow -1;
13 }
14 If ( b<0)
15 c = 1/c;
16 Output( c );
17 End

This is the program for a raised to power b. There are four independent paths in this graph.enter image description here

Path 1 Start,1,3,4,5,7,8,9,End Path 2 Start,1,2,4,5,7,9,End Path 3 Start,1,3,4,5,6,5,7,8,9,End Path 4 Start,1,2,4,5,6,5,7,8,9,End

I want an explanation in detail about each of these paths and how we found them ??

Aucun commentaire:

Enregistrer un commentaire