Question: Convert the follwing code from C++ to C #include #include #include #include #include #include main() { long int p,g,Sa=0,Sb=0,Ta,Tb,Skey1,Skey2,Skey; clrscr(); cout < >p; cout <
Convert the follwing code from C++ to C
#include
//======== Calculate Ta and Tb Values Ta=(pow(g,Sa)); Ta=Ta%p; Tb=(pow(g,Sb)); Tb=Tb%p; //======== Calculate Secret Key Values Skey1=(pow(Tb,Sa)); Skey1=Skey1%p; Skey2=(pow(Ta,Sb)); Skey2=Skey2%p; if(Skey1==Skey2) Skey=Skey1; //========= Print Secret Key Value cout<<" The random Number of SA is :"< getch(); return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
