I am supposed to calculate the combined resistance of 3 resistor in parallel to two decimal places. The formula for this is 1/(1/R1+1/R2+1/R3). Every time I try to run my program I get Unhandled exception at 0x0006507A in glavin_lab2.exe: 0xC0000094: Integer division by zero. My teacher said there might be a problem with my formula code but I don't know what I'm doing wrong.
//This program calculates the combined resistance when the three resistors are attached in parallel
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
int main()
{
double combinedResistance;
int R1, R2, R3;
//This program calculates the combined resistance when the three resistors are attached in parallel
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
int main()
{
double combinedResistance, R1, R2, R3;
'glavin_lab2.exe' (Win32): Loaded 'C:\Users\amglavin\Documents\C.S. Assignments\glavin_lab2\Debug\glavin_lab2.exe'. Symbols loaded.
'glavin_lab2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'glavin_lab2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'glavin_lab2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'glavin_lab2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp110d.dll'. Symbols loaded.
'glavin_lab2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcr110d.dll'. Symbols loaded.
Application "\??\C:\Windows\system32\cmd.exe" found in cache
The program '[7784] glavin_lab2.exe' has exited with code 0 (0x0).