Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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 themStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started