uit.cpp #include #include #include using namespace std; int main() ifstream input_file("circ

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

uit.cpp #include #include #include using namespace std; int main() ifstream input_file("circ

Post by answerhappygod »

Uit Cpp Include Iostream Include Fstream Include Iomanip Using Namespace Std Int Main Ifstream Input File Circ 1
Uit Cpp Include Iostream Include Fstream Include Iomanip Using Namespace Std Int Main Ifstream Input File Circ 1 (119.63 KiB) Viewed 57 times
Uit Cpp Include Iostream Include Fstream Include Iomanip Using Namespace Std Int Main Ifstream Input File Circ 2
Uit Cpp Include Iostream Include Fstream Include Iomanip Using Namespace Std Int Main Ifstream Input File Circ 2 (105.71 KiB) Viewed 57 times
i have written the code correctly and created the file but the compiler is not showing the results please tell me what to do???????
uit.cpp #include<iostream> #include<fstream> #include<iomanip> using namespace std; int main() ifstream input_file("circuit.txt"); ofstream output_file("results.txt"); output_file<<left<<setw(7)<<"voltage"<<"\t"«<left<<setw(7)<<"current"<<"\tpower"<<endl; double voltage, current; > while (!input_file.eof()) { input_file> voltage >>current; output_file<<left<<setw(7)<<voltage<<"\t"<<left<<setw(7)«<current<<"\t"; if (voltage>10|| current>10) I { output_file<<"H"<<endl; continue; } double power=voltage* current; output_file<<power<<endl; } input_file.close(); output_file.close(); return 0; Compile Log Debug Find Results Close

View his PC > Documents > C++ circuit results
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply