Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

why does the following code not work when inputing 1 into the first line? #include #include int main ( ) { int sets = 0

why does the following code not work when inputing 1 into the first line? #include
#include
int main(){
int sets =0;
float po, hc, sg =0;
int lowestSpec;
int cnter =0;
int counter =0;
int newArray[sets][4];
float flowRate;
printf("Enter the number of limestones to compare:");
scanf("%d", &sets);
int multiples[sets][3];
lowestSpec=10000;
for (int i =0; i < sets; i++){
counter++;
cnter++;
printf("Enter the Information, %d :", cnter);
scanf("%d", &multiples[i][0]);
scanf("%d", &multiples[i][1]);
scanf("%d", &multiples[i][2]);
}
for (int i =0; i < sets; i++){
if (multiples[i][2]< lowestSpec){
printf("%d", multiples[i][2]);
lowestSpec = multiples[i][2];
}
};
printf("The lowest specific gravity is,%d", lowestSpec);
for (int i =0; i < sets; i++){
for (int j =0; j <3; j++){
newArray[i][j]= multiples[i][j];
}
}
for (int i =0; i < sets; i++){
flowRate = newArray[i][1]*(-900);
newArray[i][3]= flowRate;
};
printf("%d", newArray[1][3]);
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions