'endl' was not declared in this scope

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Usama
    New Member
    • Nov 2013
    • 1

    'endl' was not declared in this scope

    Here is the code..
    #include <iostream>
    main()
    {
    double f_temp, k_temp, c_temp, temp;
    char ch, quit;


    std::cout << " *********** Temprature Conversion Calculator **************" ;
    std::cout << "\n\n Please enter the temprature unit for which you want the coverison ";
    std::cout << "\n 1. F for Fahrenheit to Celcius and Kalvin";
    std::cout << "\n 2. C for Celsius to Fahrenheit and Kalvin";
    std::cout << "\n 3. K for Kalvin to Fahrenheit and Celcius";
    startagain:


    std::cout << "\n\n Please enter you choice: ";
    std::cin >> ch;

    switch(ch)
    {
    case 'f':
    case 'F':
    std::cout << " Please enter temprature in Farhenheit: ";
    std::cin >> f_temp;
    c_temp = (f_temp - 32) * 5/9;
    k_temp = (f_temp + 459.67) * 5/9;
    std::cout << " Celcius =" << c_temp;
    std::cout << "\n Kelvin =" << k_temp;
    std::cout << "\n Do you want to calculate another value (y/n): ";
    std::cin >> quit;
    if (quit == 'y' || quit == 'Y')
    goto startagain;
    break;

    case 'c':
    case 'C':
    std::cout << " Please enter temprature in Celcius: ";
    std::cin >> c_temp;
    k_temp = c_temp + 273.15 ;
    f_temp = c_temp * 9/5 + 32;
    std::cout << " Kelvin =" << k_temp;
    std::cout << "\n Farhenheit =" << f_temp;
    std::cout << "\n Do you want to calculate another value (y/n): ";
    std::cin >> quit;
    if (quit == 'y' || quit == 'Y')
    goto startagain;
    break;

    case 'k':
    case 'K':
    std::cout << " Please enter temprature in Kelvin: ";
    std::cin >> k_temp;
    c_temp = k_temp - 273.15 ;
    f_temp = (k_temp - 273.14) * 9/5 + 32;
    std::cout << " Celcius =" << c_temp;
    std::cout << "\n Farhenheit =" << f_temp;
    std::cout << "\n Do you want to calcute another value (y/n): ";
    std::cin >> quit;
    if (quit == 'y' || quit == 'Y')
    goto startagain;
    break;

    default:
    std::cout << "\n Invalid Choice";
    }
    std::cout << endl<<endl;
    system("pause") ;
    }
  • M O N I
    New Member
    • Nov 2013
    • 1

    #2
    I think std::endl it's a solution for that problem :)

    Comment

    Working...