Answer:
Following are the program to this question:
#include <stdio.h>//using the header file
int main()//main method
{
int y;//defining integer variable y
printf("Enter year value:");//print message
scanf("%d", &y);//use input method for input year value
if (y>= 2101)//defining if block that checks year greater then 2101
printf("Distant future");//print message
else if (y>= 2001)//defining else if block that checks year greater then 2001
printf("21st century"); //print message
else if (y>= 1901)//defining else if block that checks year greater then 1901
printf("20th century");//print message
else //defining else block
printf("Long ago");//print message
return 0;
}
Output:
Enter year value:1998
20th century
Explanation:
In the given C language code, inside the main method, an integer variable "y" is defined, which allows the user to input the year value, and use the multiple conditions to check the given value and print message when the condition is matched.
- Inside the "if" condition block, it checks the "y" variable value is greater and equal to 2101. so, it will print "Distant future", otherwise go to the next condition.
- In this, if "y" value is greater than equal to "2001", it will print the message "21st century", otherwise go to the next condition.
- In this, If the value of "y" is greater than equal to "1901", it will print the message "20th century", and if all the above condition is not true, then it will go to the else block, and it will print "Long ago" as the message.
Answer:
to be organized
Explanation:
<h2>because when you are organized to select the correct data, you won't confused </h2>
Explanation:
To understand how this program is working let us print the variable value at different stages of the program so that we can understand how it is working.
Intitally, value=10 when it was declared.
Then we added 5 and it become value=15
then we used fork() function which creates a parent(orignal) and child(duplicate)
When fork() succeeds it returns the child pid to parent and returns 0 to the child. As you can see (pid > 0) condition is always true therefore the parent pid value becomes 35 ( 15+20) and the child pid value becomes 0.
#include <stdio.h>
#include <unistd.h>
int main( ) {
int value = 10;
printf("%d\n",value);
int pid;
value += 5;
printf("%d\n",value);
pid = fork( );
printf("%d\n",pid);
if (pid > 0 )
{
value += 20;
}
printf("%d\n",value);
return 0;
}
Output:
10 (initial value)
15 (modified value)
5343 (pid when fork is used)
35 (final modified value)
0 (child value)
15 (the parent value when fork was used)
Answer:
B. A feasible solution satisfies all constraints.
Explanation:
Linear programming can be explained as a simple technique where we depict complex relationships through linear functions then find the optimum points.
Linear programming is employed for obtaining the foremost optimal solution for a drag with given constraints. In applied mathematics,
real life problem are formulate into a mathematical model. It involves an objective function, linear inequalities with subject to constraints.
Constraints: The constraints are the restrictions or limitations on the decision variables. They usually limit the value of the decision variables.
Hence,
An infeasible solution violates all constraints.
A feasible solution point does not have to lie on the boundary of the feasible region.
An optimal solution satisfies all constraints.
Answer:
"Peer-to-peer" is the correct answer for the above question.
Explanation:
- A peer-to-peer network is a network architecture where the connected computer behaves like the server and the client itself. Any computer can behave like a server or like clients at any time.
- This is a network that is different from the client-server model and can be connected and allows to share one another hardware resource.
- The above question asked about the network architecture which is used to allow to share the hardware resources of one another's computers. The network architecture is a Peer-to-peer network.