ops sorry i forgot hmm basically i have made mind but i used C++
but our teacher want C even i already finish my c++
all i need to do is to convert c++ to c hers i made off
cpp
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <cmath>
using namespace std;
#define size 4
struct ResistorsValue
{
char ColorBand[10];
int black, brown, red, orange, yellow, green, blue, violet, gray, white; // 0 1 2 3 4 5 6 7 8 9
double gold, silver, none; // +-5% +-10% +-15%
};
//void Function(Resistor*, int, double);
void main(void)
{
int num, num2, i, colors, numcolor1, numcolor2, numcolor3;
double Value;
cout << setprecision(2) << setiosflags(ios :: fixed | ios :: showpoint);
cout << "Enter the number of Resistors value you want to create: ";
cin >> num;
cout << endl;
ResistorsValue *cal = new ResistorsValue[num];
cal.black = 1;
for(i = 0; i < num; ++i)
{
cout << "Enter information for resistor number" << i + 1 << endl;
for(colors = 0; colors < size; ++colors)
{
cout << "Enter color band number " << colors + 1 << ": ";
cin.ignore();
cin.getline(cal[colors].ColorBand,10);
}
/*num2 = 1 * pow(10, numcolor3);
Value = ((numcolor1 * 10) + numcolor2) * num; // This is the equation to calculate the resistor value.
*/
}
}
all i need is to change this to program C