Declare and initialize the following variables: monthOfYear, initialized to the value 11 companyRevenue, initialized to the value 5666777 firstClassTicketPrice, initialized to the value 6000 totalPopulation, initialized to the value 1222333

Respuesta :

Answer:

int monthOfYear=11;

long companyRevenue=5666777;

int firstClassTicketPrice=6000;

long totalPopulation=1222333;

Explanation:

Here we have declared four variable   monthOfYear ,  companyRevenue,   firstClassTicketPrice ,  totalPopulation as int ,long, int and long type .We have declared companyRevenue,totalPopulation as long type because it exceed the range of integer.

Following are the program in c language

#include <stdio.h> // header file

int main() // main function

{

int monthOfYear=11; // variable

long companyRevenue=5666777; //variable

int firstClassTicketPrice=6000;//variable

long totalPopulation=1222333;//variable

printf("%d\n%ld\n%d\n%ld",monthOfYear,companyRevenue,firstClassTicketPrice,totalPopulation); // display value

   return 0;

}

Output:

11

5666777

6000

1222333

Otras preguntas