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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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;
}
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply