#include <stdio.h>
void main()
{
struct hotel{
char name[20],address[50];
int rate,rcount,rcharge;
}hotel;
clrscr();
printf("Hotel\n-----\nName : ");
flushall(); gets(hotel.name);
printf("Address : ");
flushall(); gets(hotel.address);
printf("Rating (out of 5) : ");
flushall(); scanf("%d",&hotel.rate);
printf("No. of rooms : ");
flushall(); scanf("%d",&hotel.rcount);
printf("Room charges : Rs.");
flushall(); scanf("%d",&hotel.rcharge);
clrscr();
printf("Hotel\n-----\n");
printf("Name : %s\n",hotel.name);
printf("Address : %s\n",hotel.address);
printf("Rating (out of 5) : %d\n",hotel.rate);
printf("Rooms : %d\n",hotel.rcount);
printf("Room charges : Rs.%d",hotel.rcharge-10);
getch();
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.