actually tis would print all possible values but not the specific for user input of x, y, z.... i have edited the program above and now it works fine but takes lot of time to execute. try running if you may.

Code:

#include<stdio.h>
#include<math.h>
#include<conio.h>
int main()
{
float a, b, c, d;
int a1, b1, c1, d1;
int x = 0, y = 0, z = 0;
int x1 = 0, y1 = 0, z1 = 0;
int i = 0, j = 0;
printf("Enter X value: \n");
scanf("%d", &x);
printf("Enter Y value: \n");
scanf("%d", &y);
printf("Enter Z value: \n");
scanf("%d", &z);
for (a1 = -100 ; a1 <= 100 ; a1++)
{
printf("%d \t", j++);
for (b1 = 0; b1 <= 180; b1++)
{
for (c1 = -100; c1 <= 100; c1++)
{
for (d1 = -45; d1 <= 45; d1++)
{
a = a1 * 0.0174532925;
b = b1 * 0.0174532925;
c = c1 * 0.0174532925;
d = d1 * 0.0174532925;
x1 = (11*cos(d+c+b+a)+11*cos(d+c+b-a)+12*cos(c+b+a)+12*cos(c+b-a)+9*cos(b+a)+9*cos(b-a))/2;
if(x1 == x)
{
y1 =(11*sin(d+c+b+a)-11*sin(d+c+b-a)+12*sin(c+b+a)-12*sin(c+b-a)+9*sin(b+a)-9*sin(b-a))/2;
if(y1 == y)
{
z1 = 11*sin(d+c+b) + 12*sin(c+b) + 9*sin(b);
if(z1 == z)
{
i = 1;
goto status;
}
}
}
}
}
}
}
status:
if(i == 0)
printf("*****Positon unacheivable*****");
else
printf(" The joint angles for the desired positon are \n %d \t %d \t %d \t %d \n", a1, b1, c1, d1);
getch();