-->

program to input number of passenger and destination through air.This program should print name,destination,number of passenger and total fare

//a program to input number of passenger and destination through air.This program should print //name,destination,number of passenger and total fare using following rate.
//Destination                                                                  Rate
//      Pokhara                                                                 Rs. 2400
//    Bharaiwa                                                                 Rs. 2500
//     Biratnagar                                                               Rs. 800
//     Bhadrapur                                                               Rs. 2550
#include<stdio.h>
#include<conio.h>
void main()
{

int no_passenger;
char name[200],destination[200];
float total_fare;
printf("enter total passenger\n");
scanf("%d",&no_passenger);
printf("enter passenger name\n");
gets(name);
printf("enter destination\n");
gets(destination);
if((strcmp(destination,Pokhara))==0)
{
total_fare= 2400*no_passenger;
  printf("%s ,total passenger=%d and destination=%s\n",name,no_passenger,destination);
}
elseif(((strcmp(destination,Bhairawa))==0)
{
total_fare= 2500*no_passenger;
  printf("%s ,total passenger=%d and destination=%s\n",name,no_passenger,destination);

}
elseif(((strcmp(destination,Biratnagar))==0)
{
total_fare= 800*no_passenger;
  printf("%s ,total passenger=%d and destination=%s\n",name,no_passenger,destination);

}
elseif(((strcmp(destination,Bhadrapur))==0)
{
total_fare= 2550*no_passenger;
  printf("%s ,total passenger=%d and destination=%s\n",name,no_passenger,destination);

}
getch();
}

No comments:

Post a Comment