Hello people..!!:)
I'm a beginner in c++..

I made a program today which worked well when I ran it 2-3 times..
But now when I try to run it,nothing happens...
All I see is a black screen which disappears in a second..

What to do..??:?:

Please help me asap as I have to submit this program tomorrow..:'(

show the code you have writen or something,you changed something?what the program do?

#include<iostream.h>
#include<conio.h>
#include<graphics.h>
#include<string.h>
#include<stdio.h>
struct room
{
 int no;
 char type[50];
 int p;
};
struct d
{
 char n[25];
 char c[25];
 char add[100];
 char em[30];
 long tel;
 room r[10];
}s;
void main()
{
clrscr();
int a,k,n,bill=0,c,s1=0,s2=0,s3=0,s4=0,s5=0,c1=0,c2=0,c3=0,c4=0,c5=0,d1=0,d2=0,d3=0,d4=0,d5=0;
cout<<"                  Welcome to ";
textcolor(128+9);
settextstyle(4,0,5);
cout<<" \n             HOTEL LE MERIDIAN";
getch();
clrscr();
settextstyle(4,0,3);
cout<<"                  Welcome to ";
cout<<" \n             HOTEL LE MERIDIAN";
cout<<"\nHello!";
cout<<"\nWhat do you want to do?";
cout<<"\n\n1.Make room reservation";
cout<<"\n2.Check out our restaurant 'FOOD FOOD'";
cout<<"Please enter your choice : ";
cin>>a;
switch(a)
{
 case 1:
    cout<<"Please select the room : ";
    cout<<"\n1.AC Deluxe-Single bed";
    cout<<"\n2.AC Deluxe-Double bed";
    cout<<"\n3.Suite";
    cout<<"\n\nPlease enter your choice : ";
    cin>>c;
    textcolor(128+9);
    cprintf("\nPlease wait...");
    getch();
    clrscr();
    settextstyle(1,0,8);
    cout<<"5 rooms are available";
    cout<<"\nPlease enter your details...";
    cout<<"\n\nName : ";
    cin>>s.n;
    cout<<"\nCountry of origin : ";
    cin>>s.c;
    cout<<"\nAddress : ";
    cin>>s.add;
    cout<<"\nMobile no. : ";
    cin>>s.tel;
    cout<<"\nEmail id : ";
    cin>>s.em;
    textcolor(128+5);
    cprintf("Please wait...");
    getch();
    clrscr();
    cout<<"--------------------------------------------------------";
    cout<<"            HOTEL LE MERIDIAN                           ";
    cout<<"        ***Customer Particulars***                      ";
    cout<<"\n\nName : ";
    puts(s.n);
    cout<<"\nCountry of origin : ";
    puts(s.c);
    cout<<"\nAddress : ";
    puts(s.add);
    cout<<"\nMobile no. : "<<s.tel;
    cout<<"\nEmail id : "<<s.em;
    cout<<"\n\nThank you! Have a happy stay! ";
    cout<<"--------------------------------------------------------";
    break;
 case 2: cout<<"          Welcome to our restaurant";
     textcolor(128+5);
     cprintf("                          FOOD FOOD          ");
     m:cout<<"      ~~~~~~MENU CARD~~~~~~                  ";
     cout<<"\n\n     1.Starters";
     cout<<"\n       2.Main course";
     cout<<"\n       3.Desserts";
     cout<<"\n       4.Exit";
     cout<<"\n\nPlease enter your choice : ";
     cin>>n;
     cout<<"--------------------------------------------------------";
     if(n==1)
     {
      cout<<"------------------------------------------------------";
      s:cout<<" \n\n\n     ~~~~~~STARTERS~~~~~~                          ";
      cout<<"\n\n     Dish                  Rate(in Rs.)              ";
      cout<<"\n\n   1.Spring rolls         60.00   ";
      cout<<"\n     2.Paneer Tikka           100.00";
      cout<<"\n     3.Paneer Kathi           75.00";
      cout<<"\n     4.Veg momos              60.00";
      cout<<"\n     5.Babycorn masala        90.00";
      cout<<"\n\nPlease enter your choice : ";
      switch(c)
      {
       case 1:  bill+=90;
            s1+=1;
            break;

       case 2:  bill+=60;
            s2+=1;
            break;

       case 3:  bill+=75;
            s3+=1;
            break;

       case 4:  bill+=100;
            s4+=1;
            break;

       case 5:  bill+=60;
            s5+=1;
            break;
       default: cout<<"\n\nChoose from 1 to 5 only!";
            break;
       }
      cout<<"\n\n\nWhat do you want to do?";
      cout<<"\n\n1.Choose more from starters";
      cout<<"\n2.Go back to the main menu";
      cout<<"\n3.Generate bill";
      cout<<"\n\nPlease enter you choice : ";
      cin>>c3;
      if(c3==1)
      goto m;
      if(c3==2)
      goto b;
      }
     if(n==2)
      {
       c:cout<<"\n\n\n~~~~~~MAIN COURSE~~~~~~";
       cout<<"\n\nItem                                  Rate(inRs.)";
       cout<<"\n\n1.North Indian Thali                  150";
       cout<<"\n2.South Indian Thali                    160 ";
       cout<<"\n3.Gujrati Thali                         170 ";
       cout<<"\n4.Bengali Thali                         180 ";
       cout<<"\n5.Rajasthani Thali                      200 ";
       cout<<"\n\n\nPlease enter your choice : ";
       cin>>k;
       switch(k)
      {
       case 1:  bill+=150;
            c1+=1;
            break;

       case 2:  bill+=160;
            c2+=1;
            break;

       case 3:  bill+=170;
            c3+=1;
            break;

       case 4:  bill+=180;
            c4+=1;
            break;

       case 5:  bill+=200;
            c5+=1;
            break;
       default:cout<<"Choose from 1 to 5 only!";
            break;
       }
      cout<<"\n\n\nWhat do you want to do?";
      cout<<"\n\n1.Choose more from main course";
      cout<<"\n2.Go back to the main menu";
      cout<<"\n3.Generate bill";
      cout<<"\n\nPlease enter you choice : ";
      cin>>c2;
      if(c2==1)
      goto m;
      if(c2==2)
      goto b;
      }

     if(n==3)
      {
       d:cout<<"\n\n\n~~~~~~DESSERTS~~~~~~";
       cout<<"\n\nItem                               Rate(inRs.)";
       cout<<"\n\n1.Chocolate brownie                90";
       cout<<"\n2.Gulabjamun                         30 ";
       cout<<"\n3.Ice-cream                          20 ";
       cout<<"\n4.Tiramissu                          75";
       cout<<"\n5.Kulfi                              40";
       cout<<"\n\n\nPlease enter your choice : ";
       cin>>c4;
          switch(c4)
      {
       case 1:  bill+=40;
            d1+=1;
            break;

       case 2:  bill+=75;
            d2+=1;
            break;

       case 3:  bill+=20;
            d3+=1;
            break;

       case 4:  bill+=30;
            d4+=1;
            break;

       case 5:  bill+=90;
            d5+=1;
            break;
       default:"Choose from 1 to 5 only!";
            break;
       }
      cout<<"\n\n\nWhat do you want to do?";
      cout<<"\n\n1.Choose more from desserts";
      cout<<"\n2.Go back to the main menu";
      cout<<"\n3.Generate bill";
      cout<<"\n\nPlease enter you choice : ";
      cin>>c3;
      if(c3==1)
      goto d;
      if(c3==2)
      goto m;
      if(c3==3)
      goto b;
      }

       b:cout<<"~~~~~~~~~~~~BILL~~~~~~~~~~~~~~";
     cout<<"\n\nItem                   Price  ";
     if(s1!=0)
      cout<<"\nSpring rolls          "<<(90*s1);
     if(s2!=0)
      cout<<"\nPaneer Tikka          " <<(100*s2);
     if(s3!=0)
      cout<<"\nPaneer Kathi          " <<(75*s3);
     if(s4!=0)
      cout<<"\nVeg momos             "<<(60*s4);
     if(s5!=0)
      cout<<"\nBabycorn masala       "<<(90*s5);
     if(c1!=0)
      cout<<"\nNorth Indian Thali    "<<(150*s1);
     if(c2!=0)
      cout<<"\nSouth Indian Thali    " <<(160*s2);
     if(c3!=0)
      cout<<"\nGujarati Thali        " <<(170*s3);
     if(c4!=0)
      cout<<"\nBengali Thali         "<<(180*s4);
     if(c5!=0)
      cout<<"\nRajasthani Thali      "<<(190*s5);
     if(d1!=0)
      cout<<"\nChocolate brownie     "<<(150*s1);
     if(d2!=0)
      cout<<"\nGulabjamun            " <<(160*s2);
     if(d3!=0)
      cout<<"\nIce-cream             " <<(170*s3);
     if(d4!=0)
      cout<<"\nTiramissu             "<<(180*s4);
     if(d5!=0)
      cout<<"\nKulfi                 "<<(190*s5);
      cout<<"____________________________________";
      cout<<"                TOTAL = "<<bill;
      cout<<"-------------------------------------";
     }
 getch();
}

I know the program is too long and stretchy...
But you can also suggest something in general to fix this problem..

Run it from a console (i.e. a command line) and see what error messages you get.

Run it from a console (i.e. a command line) and see what error messages you get.

I don't really get what you mean..
But as such there is no error..
It shows 0 error but while running it,nothing appears but a black screen which vanishes after a second..:?:

A command line is the little flashing cursor on which you type commands. On windows machines, it's commonly got a black background and the text is in white. It often says something like:

C:\>

You can type the name of a programme to run. Type the name of your programme and run it.

A command line is the little flashing cursor on which you type commands. On windows machines, it's commonly got a black background and the text is in white. It often says something like:

C:\>

You can type the name of a programme to run. Type the name of your programme and run it.

Thanks a million.:)
It worked.
I used command prompt and it gave an error and then I made the correction.
Thank you so much.:)
(You really have no clue that it was such a great help.Thank you so much.:))

I do not get it still...............i used cmd and typed the name of my file...but it shows the file is not operable

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.