Write a menu driven c programm to display string in ascending and descending style

/**************************************************************/
/*Programmed by : Vivek Patel**********************************/
/*For Bugs Free feel to contact********************************/
/*Website : www.vivekpatel.cjb.net*****************************/
/*Email : vivek_patel9@rediffmail.com**************************/
/**************************************************************/


#include
#include
void main(){
char str[]="C Programming";
int i,choice;
while(1){
clrscr();
printf("*****C Programming*****\n\n");
printf("1) Ascending style\n");
printf("2) Decending style\n");
printf("3) Exit\n");
printf("Enter your choice : ");
scanf("%d",&choice);
printf("\n\n");
switch(choice){
case 1: //Ascending Style
for(i=0;str[i]!='\0';i++)
printf("%.*s\n",i,str);
printf("%.*s\n",i,str);
getch();
break;
case 2: //Decending Style
for(i=0;str[i]!='\0';i++);
while(i>0){
printf("%.*s\n",i,str);
i--;
}
getch();
break;
case 3: exit(1);
default : printf("\n\nInvalid choice\n\n");
getch();
}
}
}



Powered by Wufoo