Page 1 of 1

Q1.[10 Marks] The following C program will generate an error or a warning depending on the OS that you use. Fix this err

Posted: Sat Nov 27, 2021 2:39 pm
by answerhappygod
Q1.[10 Marks] The following C program will generate an
error or a warning depending on the OS that you use. Fix this
error. Then, explain what does the program do?
#include <math.h>
int main() {
int values[3];
printf("Enter 3 integers: ");
for(int i = 0; i < 3; ++i) {
scanf("%d", &values);
}
printf("Output: ");
for(int i = 0; i < 3; ++i) {
printf("%lf\n", sqrt(values));
}
return 0;
}