Right, i sorted my parse error with some much appreciated help, so cheers. I have another problem.
Code:
do{
printf("welcome to the Tee, Pi, Min loss pad resistor calculation program");
printf("\n\n\n");
printf("Choose your desired network\n\n");
printf("enter T=Tee network; P=Pi network; M=Min loss; Q=Quit program\n");
choice=getchar();
choice=toupper(choice);
switch(choice) {
case 'T': {
printf("Choose type of Tee network");
printf("\n\n");
printf("Enter B=Balanced; U=Unblanced\n");
type=getchar();
type=toupper(type);
switch(type){
case 'U': {
printf("enter a value for the input impeadence\n");scanf("%f",&Z);
printf("enter a value for the output impeadence\n");scanf("%f",&Z2);
printf("enter a value for the Loss\n");scanf("%f",&l);
N=pow(10,l/10);
R3=2*sqrt(N*Z*Z2)/(N-1);
printf("the value of R3 is %f\n",R3);
R2=(Z2*(N+1)/(N-1))-R3;
printf("the value of R2 is %f\n",R2);
R1=(Z*(N+1)/(N-1))-R3;
printf("the value of R1 is %f\n",R1);
break;}
case 'B': {
printf("enter a value for the input impeadence\n");scanf("%f",&Z);
printf("enter a value for the output impeadence\n");scanf("%f",&Z2);
printf("enter a value for the Loss\n");scanf("%f",&l);
N=pow(10,l/10);
R3=2*sqrt(N*Z*Z2)/(N-1);
printf("the value of R3 is %f\n",R3);
R2=(Z2*(N+1)/(N-1))-R3;
printf("the value of R2 is %f\n",R2);
R1=(Z*(N+1)/(N-1))-R3;
printf("the value of R1 is %f\n",R1);
break;}
break;}
case 'P': {
printf("Choose type of Pi network");
printf("\n\n");
printf("Enter B=Balanced; U=Unblanced\n");
type=getchar();
type=toupper(type);
}
switch(type){
I know that came out pretty much unreadable, but when i choose T from the 1st menu it also shows the options for not only Tee, but Pi too. Basically it prints out case 'T' and case 'P'. I need some kind of loop to stop it doing this but am not sure how to put one in or which one to use. I dont think i explained it very well either.
Any help/ideas/micky taking would be much appreciated as i am at the end of my very short rope as regards this!
Cheers
Andy