fibonaaci sequence fast exponentiation doubt

can someone please tell me why the answer is wrong when we do mutiply(a,a) and then fib(a,n/2) rather than fib(a,n/2) and then multiply(a,a).
why the answer is different .
here is my


[1]


  [1]: https://ideone.com/CdZXKh

Matrix multiplication is not commutative in general :stuck_out_tongue:

gotcha man

#include<iostream.h>
#include<conio.h>
int main()
{
clrscr();
char string[80], c;
cout<<“Enter string(max. 79 characters):”;
cin>>getline(string, 80);
for (int len=0;string[len]!;i<len++)
int i,j,flag=1;
for(i=0;j=len-1;i<len/2;i++,j–)
{
if string[i] != string[j])
{
flag=0;
break;
}
}
if(flag !=0)
cout<<“It is a pallindrome.”<<endl;
else
cout<<“It is not a pallindrome.”<<endl;
getch();
return 0;
}