ok so this is my code and i cant get the switch function to work (dont mind the langauge of the text its in swedishCode://uppgift.cpp #include <iostream> using namespace std; #include <float.h> int main () { float car, tal1, tal2, tal3; cout <<"*******************************\n"; cout <<"*Bensinförbruknings-kalkylator*\n"; cout <<"*******************************\n\n"; cout <<"Bekräfta med att trycka Enter\n\n"; cout << "\nInmatning - Antal körda mil : "; cin >> tal1; cout << "\nInmatning - Antal tankade liter : "; cin >> tal2; cout <<"\nVal av bil\n\n"; cout << "(1)Volvo\n"; cout << "(2)Opel\n"; cout << "(3)Saab\n"; cout << "Välj bil genom att ange en siffra mellan 1-3 : "; cin >> car; switch (car) { case 1: cout << "Mil\tBil\tLiter\tFörbrukning\n"; cout << "----\t----\t------\t------------\n"; cout << "" << tal1 << " \tVolvo\t " << tal2 << " " << (tal2/tal1) << "\n"; cout <<"\n\n\n*******************************\n"; cout <<"* BilligaBilar AB 2006 *\n"; cout <<"* Skapat av Patrik Ljung *\n"; cout <<"*******************************\n\n"; break; case 2: cout << "Mil\tBil\tLiter\tFörbrukning\n"; cout << "----\t----\t------\t------------\n"; cout << "" << tal1 << " \tOpel\t " << tal2 << " " << (tal2/tal1) << "\n"; cout <<"\n\n\n*******************************\n"; cout <<"* BilligaBilar AB 2006 *\n"; cout <<"* Skapat av Patrik Ljung *\n"; cout <<"*******************************\n\n"; break; case 3: cout << "Mil\tBil\tLiter\tFörbrukning\n"; cout << "----\t----\t------\t------------\n"; cout << "" << tal1 << " \tOpel\t " << tal2 << " " << (tal2/tal1) << "\n"; cout <<"\n\n\n*******************************\n"; cout <<"* BilligaBilar AB 2006 *\n"; cout <<"* Skapat av Patrik Ljung *\n"; cout <<"*******************************\n\n"; } return 0; }) but i cant figure out how to get the switch function to work
thank