while(1){//return from the loop only when the input is zero
printf("\n1: Stack1\n2: Stack2\n0: to return\n");
scanf("%d",&i);
switch(i){
case 1:
printf("1");
break;
case 2:
printf(" 2");
break;
case 0:
printf("Thank you for using the service");
break;
default:
printf("Give a Valid Option");
break;
}//end of switch - case
}//end of while
printf("END");
deepin 0 Newbie Poster
jonsca 1,059 Quantitative Phrenologist Team Colleague Featured Poster
Gonbe 32 Newbie Poster
vaibhav2614 0 Newbie Poster
Dave Sinkula 2,398 long time no c Team Colleague
tux4life commented: Clear post, great suggestion(s). +6
deepin 0 Newbie Poster
jonsca 1,059 Quantitative Phrenologist Team Colleague Featured Poster
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.