what should i declare when i am making a program titled order menu having a amount on

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dada morcoso
    New Member
    • Oct 2012
    • 1

    #1

    what should i declare when i am making a program titled order menu having a amount on

    Code:
    #include<stdio.h>
    
    main()
    {
          char sen[100];
          int x,y,word=0,char=0
          
          printf("\enter a sentence:");
          gets(sen);
          x=strlen(sen);
          for(y=0;y<=x;++y){
          if((sen[y]   ==")||(sen[y]=='\0'))
          ++word;
          else
          ++character;}
          printf("|n# of word:%d",word);
          printf("\n# of character:%d",character);
          getch();
          }
          #include<stdio.h>
          main();
          {
                 char name[30];
                 
                 printf("\n enter name:");
                 scanf("%s",&name);
                 printf("\n enter code:");
                 scanf("%d",&code);
                 switch (code)
                 {
                        case 1:
                             printf("\n you choose a burger value meal with coke!");break;
                        case 2:
                             printf("\n yyou choose a french fries value meal with coke!");break;
                        case 3:
                             printf("\n you choose a spaghetti with chicken value meal with coke!");break;
                        case 4:
                             printf("\n you choose chicken-rice value meal with coke!");break;
                        case 5:
                             printf("\n you choose a pizza with hot sauce value meal with coke!");break;
                       default:
                               printf("\n invalid order");break;
                               }
                       
    getch();
    }
    Last edited by Rabbit; Oct 12 '12, 02:56 PM. Reason: Please use code tags when posting cdoe.
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    Please resubmit your question in the body of the post instead of the title.

    Please use code tags with your code.

    Comment

    Working...