Ask Question
28 June, 18:55

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

+5
Answers (1)
  1. 28 June, 20:14
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers