Question: Program #1 #include #include int main(int argc, char *argv[]) { unsigned int i,j; while(1) { j = 1; for (i = 1; i { j

 Program #1 #include #include int main(int argc, char *argv[]) { unsigned

Program #1

#include

#include int main(int argc, char *argv[])

{

unsigned int i,j;

while(1)

{

j = 1;

for (i = 1; i

{

j = j*i;

}

}

} Program 2 #include

#include int main(int argc, char *argv[])

{

unsigned int i;

int count = 0;

struct timeval tv;

while(1)

{

for(i = 0; i

{

gettimeofday(&tv, NULL);

printf("%lu sec, %lu usec ", tv.tv_sec, tv.tv_usec);

}

count++;

printf("round %d complete ", count);

}

}

Write a CPU bound C program (Program 1) and an I/O bound C program (program2 using printf statements within the while(1) loop) and compile both of them

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!