Ask Question

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

+1
Answers (1)
  1. 14 August, 00:08
    0
    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 / / 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
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Declare and initialize the following variables: monthOfYear, initialized to the value 11 companyRevenue, initialized to the value 5666777 ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers