Dev C++ Cout Endl

Dev

  1. C++ Std Endl
  2. Endl And N
  3. Endl C++ Meaning

C++ Std Endl

P: 1
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 << 'nn 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 << 'nn 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');
}

Endl And N

C++ cout endl

Endl C++ Meaning

C Programming Language Tutorial - C Manipulators (endl, setw, setprecision, setf). A humble request Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website. Question about cout. Question about cout. How come in these line of code the endl code precedes the.

In this lesson, we’ll talk more about std::cout, which we used in our Hello world! Program to output the text Hello world! To the console. We’ll also explore how to get input from the user, which we will use to make our programs more interactive.