jjhaag is definatly right that alot of your code is non-standard but thats ok if your not using it on other systems. But you should define main as
int main() and have it
return 0;.
You are also missing a
} after the swith statment ending in main.
There should also be a default handle in all of the statments so anything other than 2 will be handled. So you statements would look like
CODE
switch (ch) {
case '2':
clrscr();
int n=0,sum=0;
int p= opt1(2,n,sum);
cout<<"\nThe sum of the entered digits is..."<<p;
break;
default:
break;
}
This will keep your program from throwing any errors if you give the switch statement anything other than '2'.
Also i really recommend commenting your code alittle more, makes it easier for you and me. It is also good practice to name your variables with meaning names like instead of ch use choice.