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;
}
Q1.[10 Marks] The following C program will generate an error or a warning depending on the OS that you use. Fix this err
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am